From 5865aab25cf6d380c29c9b153ad8c3c665b3cb37 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Tue, 14 Jan 2025 08:41:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E9=99=A4=E5=B1=8F=E8=94=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 43c2a4a5..5f1f51b6 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -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',