From b45ffcc0d2c8a95b6db4666bf69469ec6fae3fe4 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Mon, 29 Apr 2024 17:34:00 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E5=B7=A5=E4=BB=B6=E9=85=8D?= =?UTF-8?q?=E9=80=81=E5=90=91=E5=AF=BC2.=E5=A2=9E=E5=8A=A0rfid=E7=A0=81?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_workorder.py | 6 ++ sf_manufacturing/views/mrp_workorder_view.xml | 57 +++++++++---------- .../wizard/workpiece_delivery_wizard.py | 5 ++ 3 files changed, 39 insertions(+), 29 deletions(-) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index 2cadeef5..20077f3c 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -180,6 +180,11 @@ class ResMrpWorkOrder(models.Model): detection_report = fields.Binary('检测报告', readonly=True) is_remanufacture = fields.Boolean(string='是否重新生成制造订单', default=True) + @api.onchange('rfid_code') + def _onchange(self): + if self.rfid_code and self.state == 'progress': + self.workpiece_delivery_ids[0].write({'rfid_code': self.rfid_code}) + def get_plan_workorder(self, production_line): tomorrow = (date.today() + timedelta(days=+1)).strftime("%Y-%m-%d") tomorrow_start = tomorrow + ' 00:00:00' @@ -1106,6 +1111,7 @@ class WorkPieceDelivery(models.Model): status = fields.Selection( [('待下发', '待下发'), ('待配送', '待配送'), ('已配送', '已配送')], string='状态', default='待下发') is_cnc_program_down = fields.Boolean('程序是否下发', default=False) + rfid_code = fields.Char('rfid码') active = fields.Boolean(string="有效", default=True) @api.model diff --git a/sf_manufacturing/views/mrp_workorder_view.xml b/sf_manufacturing/views/mrp_workorder_view.xml index 0ebc58bb..9cfb9e40 100644 --- a/sf_manufacturing/views/mrp_workorder_view.xml +++ b/sf_manufacturing/views/mrp_workorder_view.xml @@ -43,7 +43,7 @@ {'invisible': ['|',("user_permissions","=",False),("name","=","获取CNC加工程序")]} - + 1 @@ -111,36 +111,38 @@ - - - - - - - - - + + + + + + + + +