summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--addons/mrp/models/mrp_production.py2
-rw-r--r--addons/mrp/models/stock_move.py5
2 files changed, 5 insertions, 2 deletions
diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py
index fd598626482..6f4613ff8e8 100644
--- a/addons/mrp/models/mrp_production.py
+++ b/addons/mrp/models/mrp_production.py
@@ -475,7 +475,7 @@ class MrpProduction(models.Model):
production.state = 'progress'
elif not float_is_zero(production.qty_producing, precision_rounding=production.product_uom_id.rounding):
production.state = 'progress'
- elif any(not float_is_zero(move.quantity_done, precision_rounding=move.product_uom.rounding) for move in production.move_raw_ids) :
+ elif any(not float_is_zero(move.quantity_done, precision_rounding=move.product_uom.rounding or move.product_id.uom_id.rounding) for move in production.move_raw_ids):
production.state = 'progress'
else:
production.state = 'confirmed'
diff --git a/addons/mrp/models/stock_move.py b/addons/mrp/models/stock_move.py
index 4e21aec49fc..294b2feeee9 100644
--- a/addons/mrp/models/stock_move.py
+++ b/addons/mrp/models/stock_move.py
@@ -415,8 +415,11 @@ class StockMove(models.Model):
def _show_details_in_draft(self):
self.ensure_one()
- if self.raw_material_production_id and self.state == 'draft':
+ production = self.raw_material_production_id or self.production_id
+ if production and (self.state != 'draft' or production.state != 'draft'):
return True
+ elif production:
+ return False
else:
return super()._show_details_in_draft()