From 7d877a0cbb22dd281cda32d7847a4cdba6e4d947 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Fri, 20 Sep 2024 11:45:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=8F=90=E7=A4=BA=E8=AF=8D?= =?UTF-8?q?=E5=88=B6=E9=80=A0=E8=AE=A2=E5=8D=95=E9=87=8D=E5=A4=8D=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=9B=E5=A4=84=E7=90=86=E8=8E=B7=E5=8F=96=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=8C=89=E9=92=AE=E6=98=BE=E9=9A=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_machine_connect/controllers/controllers.py | 2 +- sf_manufacturing/models/mrp_workorder.py | 5 ++++- sf_manufacturing/views/mrp_workorder_view.xml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sf_machine_connect/controllers/controllers.py b/sf_machine_connect/controllers/controllers.py index e301154b..5ba1261f 100644 --- a/sf_machine_connect/controllers/controllers.py +++ b/sf_machine_connect/controllers/controllers.py @@ -623,7 +623,7 @@ class Sf_Dashboard_Connect(http.Controller): # 未完成订单 not_done_orders = plan_obj.search( [('production_line_id.name', '=', line), ('state', 'not in', ['finished']), - ('production_id.state', 'not in', ['cancel']), ('active', '=', True) + ('production_id.state', 'not in', ['cancel', 'done']), ('active', '=', True) ]) # print(not_done_orders) # 完成订单 diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index 5de5e780..5a78f36b 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -1582,8 +1582,11 @@ class SfWorkOrderBarcodes(models.Model): [('routing_type', '=', '装夹预调'), ('rfid_code', '=', barcode)]) if workorder_olds: name = '' + tem_list = [] for workorder in workorder_olds: - name = '%s %s' % (name, workorder.production_id.name) + tem_list.append(workorder.production_id.name) + for i in list(set(tem_list)): + name = '%s %s' % (name, i) raise UserError('该托盘已绑定【%s】制造订单,请先解除绑定!!!' % name) if workorder: if workorder.routing_type == '装夹预调': diff --git a/sf_manufacturing/views/mrp_workorder_view.xml b/sf_manufacturing/views/mrp_workorder_view.xml index e38f502f..e5ca2660 100644 --- a/sf_manufacturing/views/mrp_workorder_view.xml +++ b/sf_manufacturing/views/mrp_workorder_view.xml @@ -520,7 +520,7 @@