[ bug #1432 ] Trigger SHIPPING_CREATE ignores interception on error

This commit is contained in:
Marcos García de La Fuente 2014-06-10 12:05:31 +02:00
parent ae0116aab0
commit e7cfb719b9
2 changed files with 17 additions and 2 deletions

View File

@ -9,6 +9,7 @@ Fix: [ bug #1416 ] Supplier order does not list document models in the select bo
supplier order card supplier order card
Fix: [ bug #1443 ] Payment conditions is erased after editing supplier invoice label or Fix: [ bug #1443 ] Payment conditions is erased after editing supplier invoice label or
limit date for payment limit date for payment
Fix: [ bug #1432 ] Trigger SHIPPING_CREATE ignores interception on error
***** ChangeLog for 3.5.3 compared to 3.5.2 ***** ***** ChangeLog for 3.5.3 compared to 3.5.2 *****
Fix: Error on field accountancy code for export profile of invoices. Fix: Error on field accountancy code for export profile of invoices.

View File

@ -272,10 +272,24 @@ class Expedition extends CommonObject
if ($result < 0) { $error++; $this->errors=$interface->errors; } if ($result < 0) { $error++; $this->errors=$interface->errors; }
// Fin appel triggers // Fin appel triggers
if (! $error)
{
$this->db->commit(); $this->db->commit();
return $this->id; return $this->id;
} }
else else
{
foreach($this->errors as $errmsg)
{
dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR);
$this->error.=($this->error?', '.$errmsg:$errmsg);
}
$this->db->rollback();
return -1*$error;
}
}
else
{ {
$error++; $error++;
$this->error=$this->db->lasterror()." - sql=$sql"; $this->error=$this->db->lasterror()." - sql=$sql";