New: Update product type with update method

This commit is contained in:
Cédric 2019-10-14 22:22:20 +02:00 committed by GitHub
parent 0d4866c38c
commit 2257706a30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -246,8 +246,13 @@ class Products extends DolibarrApi
}
$this->product->$field = $value;
}
$updatetype = false;
if ($this->product->type != $oldproduct->type && ($this->product->isProduct() || $this->product->isService())) {
$updatetype = true;
}
$result = $this->product->update($id, DolibarrApiAccess::$user, 1, 'update');
$result = $this->product->update($id, DolibarrApiAccess::$user, 1, 'update', $updatetype);
// If price mode is 1 price per product
if ($result > 0 && ! empty($conf->global->PRODUCT_PRICE_UNIQ)) {