Fix : no origin on stock mvmt when order set back to draft

This commit is contained in:
Maxime Kohlhaas
2017-04-14 15:12:32 +02:00
parent db23a5222b
commit 402924f6d7

View File

@@ -464,6 +464,7 @@ class Commande extends CommonOrder
if ($this->lines[$i]->fk_product > 0)
{
$mouvP = new MouvementStock($this->db);
$mouvP->origin = &$this;
// We increment stock of product (and sub-products)
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("OrderBackToDraftInDolibarr",$this->ref));
if ($result < 0) { $error++; $this->error=$mouvP->error; break; }