优化制造订单菜单
This commit is contained in:
@@ -102,6 +102,9 @@ class MrpProduction(models.Model):
|
||||
elif not production.workorder_ids and float_compare(production.qty_producing, production.product_qty,
|
||||
precision_rounding=production.product_uom_id.rounding) >= 0:
|
||||
production.state = 'to_close'
|
||||
elif any(
|
||||
wo.test_results == '返工' and wo.state == 'done' for wo in production.workorder_ids):
|
||||
production.state = 'rework'
|
||||
elif any(wo_state in ('progress', 'done') for wo_state in production.workorder_ids.mapped('state')):
|
||||
production.state = 'progress'
|
||||
elif production.product_uom_id and not float_is_zero(production.qty_producing,
|
||||
|
||||
@@ -957,7 +957,6 @@ class ResMrpWorkOrder(models.Model):
|
||||
# record.write({'process_state': '待加工'})
|
||||
record.production_id.process_state = '待解除装夹'
|
||||
if record.test_results in ['返工']:
|
||||
record.production_id.state = 'rework'
|
||||
record.production_id.write({'detection_result_ids': [(0, 0, {
|
||||
'rework_reason': record.reason,
|
||||
'detailed_reason': record.detailed_reason,
|
||||
|
||||
Reference in New Issue
Block a user