Accept Merge Request #1791: (feature/制造功能优化 -> develop)
Merge Request: 调整程序写入逻辑 Created By: @马广威 Accepted By: @马广威 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1791?initial=true
This commit is contained in:
@@ -1295,7 +1295,7 @@ class MrpProduction(models.Model):
|
||||
for rework_item in rework_workorder:
|
||||
pending_workorder = production.workorder_ids.filtered(
|
||||
lambda m1: m1.state in [
|
||||
'pending'] and m1.processing_panel == rework_item.processing_panel and m1.routing_type == 'CNC加工')
|
||||
'pending'] and m1.processing_panel == rework_item.processing_panel and m1.routing_type in ['CNC加工', '人工线下加工'])
|
||||
if not pending_workorder.cnc_ids:
|
||||
production.get_new_program(rework_item.processing_panel)
|
||||
# production.write({'state': 'progress', 'programming_state': '已编程', 'is_rework': False})
|
||||
@@ -1338,7 +1338,7 @@ class MrpProduction(models.Model):
|
||||
if productions:
|
||||
for production in productions:
|
||||
panel_workorder = production.workorder_ids.filtered(lambda
|
||||
pw: pw.processing_panel == processing_panel and pw.routing_type == 'CNC加工' and pw.state not in (
|
||||
pw: pw.processing_panel == processing_panel and pw.routing_type in ['CNC加工', '人工线下加工'] and pw.state not in (
|
||||
'rework', 'done'))
|
||||
if panel_workorder:
|
||||
if panel_workorder.cmm_ids:
|
||||
|
||||
@@ -103,7 +103,8 @@ class Sf_Mrs_Connect(http.Controller, MultiInheritController):
|
||||
try:
|
||||
logging.info(f'已更新制造订单:{productions}')
|
||||
re_tool_chekout = False
|
||||
re_tool_chekout = productions.production_cnc_tool_checkout()
|
||||
productions_temp = productions.filtered(lambda p: p.production_type == '自动化产线加工')
|
||||
re_tool_chekout = productions_temp.production_cnc_tool_checkout()
|
||||
if re_tool_chekout:
|
||||
return json.JSONEncoder().encode({'status': -3, 'message': '对cnc工单的程序用刀进行校验失败'})
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user