Merge pull request #6711 from atm-maxime/fix_stockmvt_origin

Fix : no origin on stock mvmt when order set back to draft
This commit is contained in:
Juanjo Menent 2017-04-16 10:31:45 +02:00 committed by GitHub
commit f059ab0042

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; }