forked from Wavyzz/dolibarr
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:
@@ -1205,6 +1205,8 @@ class Commande extends CommonOrder
|
||||
// Insert line
|
||||
$this->line=new OrderLine($this->db);
|
||||
|
||||
$this->line->context = $this->context;
|
||||
|
||||
$this->line->fk_commande=$this->id;
|
||||
$this->line->label=$label;
|
||||
$this->line->desc=$desc;
|
||||
@@ -1319,6 +1321,8 @@ class Commande extends CommonOrder
|
||||
|
||||
$line=new OrderLine($this->db);
|
||||
|
||||
$line->context = $this->context;
|
||||
|
||||
$line->fk_product=$idproduct;
|
||||
$line->desc=$prod->description;
|
||||
$line->qty=$qty;
|
||||
@@ -2401,6 +2405,8 @@ class Commande extends CommonOrder
|
||||
// Update line
|
||||
$this->line=new OrderLine($this->db);
|
||||
|
||||
$this->line->context = $this->context;
|
||||
|
||||
// Stock previous line records
|
||||
$staticline=new OrderLine($this->db);
|
||||
$staticline->fetch($rowid);
|
||||
|
||||
Reference in New Issue
Block a user