diff --git a/sf_bf_connect/models/process_status.py b/sf_bf_connect/models/process_status.py index 6bdda2df..f4c4d859 100644 --- a/sf_bf_connect/models/process_status.py +++ b/sf_bf_connect/models/process_status.py @@ -17,6 +17,11 @@ class StatusChange(models.Model): logging.info('函数已经执行=============') server_product_none = [] for order in self.order_line: + gain_way_no = order.product_template_id.model_process_parameters_ids.filtered(lambda a: not a.gain_way) + if gain_way_no: + process_parameters = [item.name for item in gain_way_no] + raise UserError( + _("请先至【制造】-【配置】中【表面工艺可选参数】为【%s】填写获取方式", ", ".join(process_parameters))) for item in order.product_template_id.model_process_parameters_ids: if item.gain_way == '外协': server_product = self.env['product.template'].search( @@ -25,7 +30,7 @@ class StatusChange(models.Model): if not server_product: server_product_none.append(item.name) if server_product_none: - raise UserError(_("请先至【产品】中创建【表面工艺参数】为%s的服务产品", ", ".join(server_product_none))) + raise UserError(_("请先至【产品】中创建【表面工艺参数】为【%s】的服务产品", ", ".join(server_product_none))) # 使用super()来调用原始方法(在本例中为'sale.order'模型的'action_confirm'方法) try: