diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 25ad34b4..43c2a4a5 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -1650,14 +1650,12 @@ class MrpProduction(models.Model): if len(self) > 1: raise UserError('仅支持选择单个制造订单进行编程申请,请重新选择') # problem_productions = [] - # for production in self: - # if production.state not in ['待排程', '待加工'] or production.programming_state != '已编程': - # problem_productions.append(production.name) + for production in self: + if production.state not in ['待排程', '待加工'] or production.programming_state != '已编程': + problem_productions.append(production.name) # if problem_productions: # raise UserError('以下制造订单状态或编程状态不符合要求: %s' % ', '.join(problem_productions)) - # 上述通过后,返回一个action id为sf_programming_reason_action,用作二次确认wizard,显示“重新编程原因:XXXXX(用户录入)注意:该制造订单产品已申请重新编程次数为N,且当前编程状态为XXX” - cloud_programming = self._cron_get_programming_state() return { 'type': 'ir.actions.act_window', 'res_model': 'sf.programming.reason',