summaryrefslogtreecommitdiff
path: root/addons/sale_mrp
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2020-01-06 10:02:49 +0000
committerNicolas Martinelli <nim@odoo.com>2020-01-07 08:49:28 +0000
commitade80e0f8c2a6451c5ca5b55bb9e85cecac82a1b (patch)
treea373def5b288a7be54b06b0f62c68ed196ee6b2a /addons/sale_mrp
parent427e8d76a36916a5329df5a51233f12715b64e40 (diff)
[FIX] sale_mrp: use `previous_product_uom_qty`
Since revision cb618e9a99ea3b86fdeed0, `previous_product_uom_qty` is not set in the context anymore but passed as parameter. opw-2146706 closes odoo/odoo#42820 X-original-commit: 33741910e32680e644e2509d108b0cd4a4138013 Related: odoo/enterprise#7565 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/sale_mrp')
-rw-r--r--addons/sale_mrp/models/sale_mrp.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/sale_mrp/models/sale_mrp.py b/addons/sale_mrp/models/sale_mrp.py
index 8bba330ca30..3fa0d216235 100644
--- a/addons/sale_mrp/models/sale_mrp.py
+++ b/addons/sale_mrp/models/sale_mrp.py
@@ -68,6 +68,6 @@ class SaleOrderLine(models.Model):
# and after update, and return the difference. We don't take into account what was already
# sent, or any other exceptional case.
bom = self.env['mrp.bom']._bom_find(product=self.product_id, bom_type='phantom')
- if bom and 'previous_product_uom_qty' in self.env.context:
+ if bom and previous_product_uom_qty:
return previous_product_uom_qty and previous_product_uom_qty.get(self.id, 0.0)
return super(SaleOrderLine, self)._get_qty_procurement(previous_product_uom_qty=previous_product_uom_qty)