From 237afe8e5046915a162f709a8d418940f85c0c3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Voet=20=28ryv=29?= Date: Thu, 30 Jan 2020 08:10:50 +0000 Subject: [PATCH] [FIX] mrp: fix the unbuild button We get a traceback when we try to unbuild a MO due to a inexistant field call (scrap_qty) instead of product_qty -> 8458cc18674b267e64f95aa311a210ed5be41c51. Fix the issue. closes odoo/odoo#44249 Signed-off-by: Simon Lejeune (sle) --- addons/mrp/models/mrp_unbuild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/models/mrp_unbuild.py b/addons/mrp/models/mrp_unbuild.py index 9d57f1b71b9..052d96ced7e 100644 --- a/addons/mrp/models/mrp_unbuild.py +++ b/addons/mrp/models/mrp_unbuild.py @@ -276,7 +276,7 @@ class MrpUnbuild(models.Model): self.ensure_one() precision = self.env['decimal.precision'].precision_get('Product Unit of Measure') available_qty = self.env['stock.quant']._get_available_quantity(self.product_id, self.location_id, self.lot_id, strict=True) - unbuild_qty = self.product_uom_id._compute_quantity(self.scrap_qty, self.product_id.uom_id) + unbuild_qty = self.product_uom_id._compute_quantity(self.product_qty, self.product_id.uom_id) if float_compare(available_qty, unbuild_qty, precision_digits=precision) >= 0: return self.action_unbuild() else: