Merge branch 'feature/程序用刀校验优化' into feature/用刀校验优化

This commit is contained in:
yuxianghui
2024-10-17 17:02:17 +08:00

View File

@@ -948,6 +948,8 @@ class MrpProduction(models.Model):
if production.programming_no in program_to_production_names: if production.programming_no in program_to_production_names:
productions_not_delivered = self.env['mrp.production'].search( productions_not_delivered = self.env['mrp.production'].search(
[('programming_no', '=', production.programming_no), ('programming_state', '=', '已编程未下发')]) [('programming_no', '=', production.programming_no), ('programming_state', '=', '已编程未下发')])
productions = self.env['mrp.production'].search(
[('programming_no', '=', production.programming_no), ('state', 'not in', ('cancel', 'done'))])
rework_workorder = production.workorder_ids.filtered(lambda m: m.state == 'rework') rework_workorder = production.workorder_ids.filtered(lambda m: m.state == 'rework')
if rework_workorder: if rework_workorder:
for rework_item in rework_workorder: for rework_item in rework_workorder:
@@ -960,12 +962,12 @@ class MrpProduction(models.Model):
productions_not_delivered.write( productions_not_delivered.write(
{'state': 'progress', 'programming_state': '已编程', 'is_rework': False}) {'state': 'progress', 'programming_state': '已编程', 'is_rework': False})
# 对制造订单所以面的cnc工单的程序用刀进行校验 # 对制造订单所以面的cnc工单的程序用刀进行校验
try: try:
logging.info(f'已更新制造订单:{productions_not_delivered}') logging.info(f'已更新制造订单:{productions_not_delivered}')
productions_not_delivered.production_cnc_tool_checkout() productions.production_cnc_tool_checkout()
except Exception as e: except Exception as e:
logging.info(f'对cnc工单的程序用刀进行校验报错{e}') logging.info(f'对cnc工单的程序用刀进行校验报错{e}')
# 从cloud获取重新编程过的最新程序 # 从cloud获取重新编程过的最新程序
def get_new_program(self, processing_panel): def get_new_program(self, processing_panel):