Merge pull request #8951 from fappels/7.0_fix_ErrorProductAlreadyExists
Fix Wrong error for duplicate ref if barcode enabled but not set.
This commit is contained in:
commit
76ee88f0b1
@ -1000,7 +1000,7 @@ class Product extends CommonObject
|
||||
if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||
{
|
||||
$langs->load("errors");
|
||||
if (empty($conf->barcode->enabled)) $this->error=$langs->trans("Error")." : ".$langs->trans("ErrorProductAlreadyExists",$this->ref);
|
||||
if (empty($conf->barcode->enabled) || empty($this->barcode)) $this->error=$langs->trans("Error")." : ".$langs->trans("ErrorProductAlreadyExists",$this->ref);
|
||||
else $this->error=$langs->trans("Error")." : ".$langs->trans("ErrorProductBarCodeAlreadyExists",$this->barcode);
|
||||
$this->errors[]=$this->error;
|
||||
$this->db->rollback();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user