summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2017-03-08 10:47:19 +0100
committerNicolas Martinelli <nim@odoo.com>2017-03-08 10:47:19 +0100
commit218a21a37e6af2e2ba0e2b4d8d61d8d52a7547fc (patch)
treef9a5e5054595a15e5eec268d9ff5f70dde7860fb
parent4ce309dfabc173183c8102080192366d154fa239 (diff)
[FIX] sale: do not run procurement twice
When procurements are created, they are automatically run. Avoid this behavior, to run all procurements at the end of the process and used the optimized JIT behavior. opw-710007
-rw-r--r--addons/sale/sale.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index 35db9cec6e6..83dcb3111df 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -596,7 +596,7 @@ class SaleOrderLine(models.Model):
vals = line._prepare_order_line_procurement(group_id=line.order_id.procurement_group_id.id)
vals['product_qty'] = line.product_uom_qty - qty
- new_proc = self.env["procurement.order"].create(vals)
+ new_proc = self.env["procurement.order"].with_context(procurement_autorun_defer=True).create(vals)
new_procs += new_proc
new_procs.run()
return new_procs