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 @@