From 60560fe19566809ad2b381ba1ebeca2cb53349fe Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Wed, 19 Jun 2024 17:40:49 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BC=98=E5=8C=96=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E8=A7=A3=E7=BB=91Rfid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_workorder.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index d2e92266..ba7bc2c5 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -50,7 +50,6 @@ class ResMrpWorkOrder(models.Model): manual_quotation = fields.Boolean('人工编程', default=False, readonly=True) - @api.onchange('users_ids') def get_user_permissions(self): uid = self.env.uid @@ -1012,11 +1011,15 @@ class ResMrpWorkOrder(models.Model): for workorder in record.production_id.workorder_ids: if workorder.state != 'done': 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: if workorder.processing_panel == record.processing_panel: - workorder.rfid_code_old = workorder.rfid_code - workorder.rfid_code = None + rfid_code = workorder.rfid_code + 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: move_raw_id.quantity_done = move_raw_id.product_uom_qty record.process_state = '已完工'