2
0
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:
Laurent Destailleur
2015-02-26 13:19:19 +01:00
parent 41a74c62e2
commit fe7889e266
3 changed files with 37 additions and 19 deletions

View File

@@ -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);