解决工单完成的问题
This commit is contained in:
@@ -320,11 +320,7 @@ class MrpProduction(models.Model):
|
||||
elif production.state == 'pending_cam' and production.schedule_state == '未排':
|
||||
production.state = 'confirmed'
|
||||
elif production.state == 'to_close' and production.schedule_state == '已排':
|
||||
if all(
|
||||
wo_state in ('done', 'cancel') for wo_state in production.workorder_ids.mapped('state')):
|
||||
production.state = 'done'
|
||||
else:
|
||||
production.state = 'pending_cam'
|
||||
production.state = 'pending_cam'
|
||||
elif production.state == 'confirmed' and production.is_adjust is True:
|
||||
production.state = 'technology_to_confirmed'
|
||||
if production.state == 'confirmed' and production.schedule_state == '已排':
|
||||
|
||||
@@ -1361,7 +1361,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
# record.recreateManufacturingOrWorkerOrder()
|
||||
is_production_id = False
|
||||
rework_workorder = record.production_id.workorder_ids.filtered(lambda p: p.state == 'rework')
|
||||
done_workorder = record.production_id.workorder_ids.filtered(lambda p1: p1.state == 'done')
|
||||
done_workorder = record.production_id.workorder_ids.filtered(lambda p1: p1.state in ['done'])
|
||||
if (len(rework_workorder) + len(done_workorder) == len(record.production_id.workorder_ids)) or (
|
||||
len(done_workorder) == len(record.production_id.workorder_ids)):
|
||||
is_production_id = True
|
||||
@@ -1378,7 +1378,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
# workorder.rfid_code_old = rfid_code
|
||||
# workorder.rfid_code = False
|
||||
logging.info('workorder.rfid_code:%s' % workorder.rfid_code)
|
||||
if is_production_id is True and record.routing_type in ['解除装夹', '表面工艺']:
|
||||
if is_production_id is True and record.routing_type in ['解除装夹', '表面工艺', '切割']:
|
||||
logging.info('product_qty:%s' % record.production_id.product_qty)
|
||||
for move_raw_id in record.production_id.move_raw_ids:
|
||||
move_raw_id.quantity_done = move_raw_id.product_uom_qty
|
||||
|
||||
Reference in New Issue
Block a user