diff --git a/sf_machine_connect/controllers/controllers.py b/sf_machine_connect/controllers/controllers.py index ad958485..dcfa3ea2 100644 --- a/sf_machine_connect/controllers/controllers.py +++ b/sf_machine_connect/controllers/controllers.py @@ -767,11 +767,14 @@ class Sf_Dashboard_Connect(http.Controller): for line in line_list: # 未完成订单 - not_done_orders = plan_obj.search( - [('production_line_id.name', '=', line), ('state', 'not in', ['finished']), - ('production_id.state', 'not in', ['cancel', 'done']), ('active', '=', True) + # not_done_orders = plan_obj.search( + # [('production_line_id.name', '=', line), ('state', 'not in', ['finished']), + # ('production_id.state', 'not in', ['cancel', 'done']), ('active', '=', True) + # ]) + not_done_orders = request.env['mrp.workorder'].sudo().search( + [('production_line_id.name', '=', line), ('state', 'in', ['ready', 'progress']), + ('routing_type', '=', 'CNC加工') ]) - # print(not_done_orders) # 完成订单 # 获取当前时间,并计算24小时前的时间 @@ -823,16 +826,18 @@ class Sf_Dashboard_Connect(http.Controller): 'draft': '待排程', 'done': '已排程', 'processing': '生产中', - 'finished': '已完成' + 'finished': '已完成', + 'ready': '待加工', + 'progress': '生产中', } line_dict = { 'sequence': id_to_sequence[order.id], - 'workorder_name': order.name, + 'workorder_name': order.production_id.name, 'blank_name': blank_name, 'material': material, 'dimensions': dimensions, - 'order_qty': order.product_qty, + 'order_qty': 1, 'state': state_dict[order.state], }