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