1、优化工单解绑Rfid
This commit is contained in:
@@ -50,7 +50,6 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
|
|
||||||
manual_quotation = fields.Boolean('人工编程', default=False, readonly=True)
|
manual_quotation = fields.Boolean('人工编程', default=False, readonly=True)
|
||||||
|
|
||||||
|
|
||||||
@api.onchange('users_ids')
|
@api.onchange('users_ids')
|
||||||
def get_user_permissions(self):
|
def get_user_permissions(self):
|
||||||
uid = self.env.uid
|
uid = self.env.uid
|
||||||
@@ -1012,11 +1011,15 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
for workorder in record.production_id.workorder_ids:
|
for workorder in record.production_id.workorder_ids:
|
||||||
if workorder.state != 'done':
|
if workorder.state != 'done':
|
||||||
is_production_id = False
|
is_production_id = False
|
||||||
if is_production_id is True and record.routing_type in ['解除装夹', '表面工艺']:
|
if record.routing_type == '解除装夹':
|
||||||
for workorder in record.production_id.workorder_ids:
|
for workorder in record.production_id.workorder_ids:
|
||||||
if workorder.processing_panel == record.processing_panel:
|
if workorder.processing_panel == record.processing_panel:
|
||||||
workorder.rfid_code_old = workorder.rfid_code
|
rfid_code = workorder.rfid_code
|
||||||
workorder.rfid_code = None
|
workorder.write({'rfid_code_old': rfid_code,
|
||||||
|
'rfid_code': ''})
|
||||||
|
workorder.rfid_code_old = rfid_code
|
||||||
|
workorder.rfid_code = ''
|
||||||
|
if is_production_id is True and record.routing_type in ['解除装夹', '表面工艺']:
|
||||||
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
|
||||||
record.process_state = '已完工'
|
record.process_state = '已完工'
|
||||||
|
|||||||
Reference in New Issue
Block a user