Skip to content
Permalink
Browse files

[FIX] mrp: compute 'is_produced' only when production

- when there is no production for the workorder, then it will return rounding as none and in result it will throw traceback.
- so, set rounding only when there is production.

Related to Issue: 1957994
  • Loading branch information...
pka-odoo committed Mar 26, 2019
1 parent 9ea4fef commit 660dbbdf3b150ac8599e5cfa9fc294074c17b824
Showing with 2 additions and 0 deletions.
  1. +2 −0 addons/mrp/models/mrp_workorder.py
@@ -125,6 +125,8 @@ def name_get(self):
@api.one
@api.depends('production_id.product_qty', 'qty_produced')
def _compute_is_produced(self):
if not self.production_id:
return
rounding = self.production_id.product_uom_id.rounding
self.is_produced = float_compare(self.qty_produced, self.production_id.product_qty, precision_rounding=rounding) >= 0

0 comments on commit 660dbbd

Please sign in to comment.
You can’t perform that action at this time.