[FIX] mrp: always set a value to computed fiec

Records were filtered so not every record was set in the for loop

Fixes odoo/odoo#38992
Closes odoo/odoo#39071

closes odoo/odoo#39234

X-original-commit: f7d5ba6f9ffccecffbb5b851bd2770ecef28520c
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit is contained in:
Swapnesh Shah
2019-10-23 09:10:02 +00:00
committed by fw-bot
parent 6c37759a48
commit 2fc92802cd
+2 -1
View File
@@ -237,7 +237,8 @@ class MrpWorkorder(models.Model):
@api.depends('production_id.product_qty', 'qty_produced')
def _compute_is_produced(self):
for order in self:
self.is_produced = False
for order in self.filtered(lambda p: p.production_id):
rounding = order.production_id.product_uom_id.rounding
order.is_produced = float_compare(order.qty_produced, order.production_id.product_qty, precision_rounding=rounding) >= 0