修改未完成订单明细的判断逻辑
This commit is contained in:
@@ -880,13 +880,13 @@ class Sf_Dashboard_Connect(http.Controller):
|
|||||||
current_time = datetime.now()
|
current_time = datetime.now()
|
||||||
time_48_hours_ago = current_time - timedelta(hours=48)
|
time_48_hours_ago = current_time - timedelta(hours=48)
|
||||||
|
|
||||||
# 计划量,目前只能从mail.message中筛选出
|
# # 计划量,目前只能从mail.message中筛选出
|
||||||
plan_order_messages = request.env['mail.message'].sudo().search([
|
# plan_order_messages = request.env['mail.message'].sudo().search([
|
||||||
('model', '=', 'mrp.workorder'),
|
# ('model', '=', 'mrp.workorder'),
|
||||||
('create_date', '>=', time_48_hours_ago.strftime('%Y-%m-%d %H:%M:%S')),
|
# ('create_date', '>=', time_48_hours_ago.strftime('%Y-%m-%d %H:%M:%S')),
|
||||||
('tracking_value_ids.field_desc', '=', '状态'),
|
# ('tracking_value_ids.field_desc', '=', '状态'),
|
||||||
('tracking_value_ids.new_value_char', 'in', ['就绪', '生产中'])
|
# ('tracking_value_ids.new_value_char', 'in', ['就绪', '生产中'])
|
||||||
])
|
# ])
|
||||||
|
|
||||||
for line in line_list:
|
for line in line_list:
|
||||||
not_done_data = []
|
not_done_data = []
|
||||||
@@ -908,16 +908,18 @@ class Sf_Dashboard_Connect(http.Controller):
|
|||||||
# [('production_line_id.name', '=', line), ('state', 'not in', ['finished']),
|
# [('production_line_id.name', '=', line), ('state', 'not in', ['finished']),
|
||||||
# ('production_id.state', 'not in', ['cancel', 'done']), ('active', '=', True)
|
# ('production_id.state', 'not in', ['cancel', 'done']), ('active', '=', True)
|
||||||
# ])
|
# ])
|
||||||
# not_done_orders = work_order_obj.search(work_order_domain +
|
not_done_orders = work_order_obj.search(work_order_domain + [
|
||||||
# [('state', 'in', ['ready', 'progress'])], order='id asc'
|
('state', 'in', ['ready', 'progress']),
|
||||||
# )
|
('date_planned_start', '>=', time_48_hours_ago)
|
||||||
not_done_orders = request.env['mrp.workorder'].sudo().browse(plan_order_messages.mapped('res_id'))
|
], order='id asc'
|
||||||
if line == '业绩总览':
|
)
|
||||||
not_done_orders = not_done_orders.filtered(lambda o: o.routing_type in ['人工线下加工', 'CNC加工'])
|
# not_done_orders = request.env['mrp.workorder'].sudo().browse(plan_order_messages.mapped('res_id'))
|
||||||
elif line == '人工线下加工中心':
|
# if line == '业绩总览':
|
||||||
not_done_orders = not_done_orders.filtered(lambda o: o.routing_type == '人工线下加工')
|
# not_done_orders = not_done_orders.filtered(lambda o: o.routing_type in ['人工线下加工', 'CNC加工'])
|
||||||
else:
|
# elif line == '人工线下加工中心':
|
||||||
not_done_orders = not_done_orders.filtered(lambda o: o.routing_type == 'CNC加工' and o.production_line_id.name == line)
|
# not_done_orders = not_done_orders.filtered(lambda o: o.routing_type == '人工线下加工')
|
||||||
|
# else:
|
||||||
|
# not_done_orders = not_done_orders.filtered(lambda o: o.routing_type == 'CNC加工' and o.production_line_id.name == line)
|
||||||
|
|
||||||
|
|
||||||
# 完成订单
|
# 完成订单
|
||||||
@@ -996,7 +998,7 @@ class Sf_Dashboard_Connect(http.Controller):
|
|||||||
|
|
||||||
line_dict = {
|
line_dict = {
|
||||||
'sequence': done_index,
|
'sequence': done_index,
|
||||||
'workorder_name': finish_order.name,
|
'workorder_name': finish_order.production_id.name,
|
||||||
'blank_name': blank_name,
|
'blank_name': blank_name,
|
||||||
'material': material,
|
'material': material,
|
||||||
'dimensions': dimensions,
|
'dimensions': dimensions,
|
||||||
|
|||||||
Reference in New Issue
Block a user