去掉客户部分字段必填校验和返工报废代码

This commit is contained in:
jinling.yang
2024-06-17 09:52:18 +08:00
parent 6a7fa89b67
commit 2862c5a888
6 changed files with 44 additions and 100 deletions

View File

@@ -996,15 +996,15 @@ class ResMrpWorkOrder(models.Model):
record.write({
'date_planned_finished': tem_date_planned_finished # 保持原值
})
if record.routing_type == 'CNC加工':
record.write({
'date_finished': tem_date_finished # 保持原值
})
if record.routing_type == 'CNC加工' and record.test_results in ['返工', '报废']:
record.production_id.action_cancel()
record.production_id.workorder_ids.write({'rfid_code': False, 'rfid_code_old': record.rfid_code})
if record.is_remanufacture is True:
record.recreateManufacturingOrWorkerOrder()
# if record.routing_type == 'CNC加工':
# record.write({
# 'date_finished': tem_date_finished # 保持原值
# })
# if record.routing_type == 'CNC加工' and record.test_results in ['返工', '报废']:
# record.production_id.action_cancel()
# record.production_id.workorder_ids.write({'rfid_code': False, 'rfid_code_old': record.rfid_code})
# if record.is_remanufacture is True:
# record.recreateManufacturingOrWorkerOrder()
is_production_id = True
for workorder in record.production_id.workorder_ids:
if workorder.state != 'done':