diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 114f6a8df53..3c37530ea3e 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -179,12 +179,6 @@ if (empty($reshook)) ); } - if (!$error && $object->update($object->id, $user) < 1) { - $error++; - setEventMessage($object->error, 'errors'); - $action = 'edit_price'; - } - if (!$error) { $db->begin(); @@ -215,6 +209,11 @@ if (empty($reshook)) } } + if (!$error && $object->update($object->id, $user) < 0) { + $error++; + setEventMessage($object->error, 'errors'); + } + if (empty($error)) { $action = ''; setEventMessage($langs->trans("RecordSaved"));