diff --git a/sf_message/models/sf_message_workorder.py b/sf_message/models/sf_message_workorder.py index 505b6f93..9c3cb9f5 100644 --- a/sf_message/models/sf_message_workorder.py +++ b/sf_message/models/sf_message_workorder.py @@ -12,7 +12,7 @@ class SFMessageWork(models.Model): _name = 'mrp.workorder' _inherit = ['mrp.workorder', 'jikimo.message.dispatch'] - @api.depends('production_availability', 'blocked_by_workorder_ids.state') + @api.depends('production_availability', 'blocked_by_workorder_ids.state', 'production_id.tool_state') def _compute_state(self): super(SFMessageWork, self)._compute_state() for workorder in self: diff --git a/sf_tool_management/models/mrp_workorder.py b/sf_tool_management/models/mrp_workorder.py index 38d952f5..d346937a 100644 --- a/sf_tool_management/models/mrp_workorder.py +++ b/sf_tool_management/models/mrp_workorder.py @@ -209,7 +209,7 @@ class MrpProduction(models.Model): logging.info(f'库存缺刀:{missing_tool_2}') # 调用CAM工单程序用刀计划创建方法 cnc_ids = self.env['sf.cnc.processing'].sudo().search( - [('workorder_id', 'in', workorder_ids.filtered(lambda a: a.production_id == self[0].id).ids), + [('workorder_id', 'in', workorder_ids.filtered(lambda a: a.production_id == self[0]).ids), ('cutting_tool_name', 'in', missing_tool_2)]) if cnc_ids: logging.info('调用CAM工单程序用刀计划创建方法!!!')