[FIX] mrp: hide detail operations button on MO draft
Since the user can't input quantity done on stock move without tracking. He shouldn't be able to do it for tracked products.
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user