解除屏蔽

This commit is contained in:
mgw
2025-01-14 08:41:41 +08:00
parent 8b5740ece2
commit 5865aab25c

View File

@@ -1649,12 +1649,12 @@ class MrpProduction(models.Model):
print('申请编程')
if len(self) > 1:
raise UserError('仅支持选择单个制造订单进行编程申请,请重新选择')
# problem_productions = []
problem_productions = []
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))
if problem_productions:
raise UserError('制造订单%s的状态(仅限待排程、待加工)或编程状态(仅限已编程)不符合要求,请检查!' % ' '.join(problem_productions))
return {
'type': 'ir.actions.act_window',