mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 00:52:01 +01:00
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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user