Fix trigger to insert lines where called when inserting line but also

when cloning parent object, making no way to know when to use them or
not. I introduced a context to allow code to know that and do not
triggers twice.
This commit is contained in:
Laurent Destailleur
2015-02-26 13:03:17 +01:00
parent 386eaf0911
commit 41a74c62e2
15 changed files with 196 additions and 149 deletions

View File

@@ -878,6 +878,8 @@ class Commande extends CommonOrder
$error=0;
$this->context['createfromclone'] = 'createfromclone';
$this->db->begin();
// get extrafields so they will be clone
@@ -942,6 +944,8 @@ class Commande extends CommonOrder
// End call triggers
}
unset($this->context['createfromclone']);
// End
if (! $error)
{