From d7d5ccc14205791a94b6c59d80bef6072e3b735f Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Mon, 1 Jul 2024 17:27:52 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9D=A1=E4=BB=B6=E5=8F=8A=E7=89=A9=E6=B5=81?= =?UTF-8?q?=E7=9A=84=E5=AE=B9=E9=94=99=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_bf_connect/models/jd_eclp.py | 2 +- sf_manufacturing/models/mrp_production.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sf_bf_connect/models/jd_eclp.py b/sf_bf_connect/models/jd_eclp.py index 744bb6d1..7879938e 100644 --- a/sf_bf_connect/models/jd_eclp.py +++ b/sf_bf_connect/models/jd_eclp.py @@ -175,7 +175,7 @@ class JdEclp(models.Model): 'type': 'success', 'message': '物流下单成功', 'sticky': False, - 'next': {'type': 'ir.actions.client', 'tag': 'soft_reload'} + 'next': {'type': 'ir.actions.client', 'tag': 'reload'} } } diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 7464886d..71cd86b5 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -111,7 +111,7 @@ class MrpProduction(models.Model): production.state = 'progress' # # 新添加的状态逻辑 - if production.state == 'to_close' and production.schedule_state == '未排': + if (production.state == 'to_close' or production.state == 'progress') and production.schedule_state == '未排': production.state = 'confirmed' elif production.state == 'to_close' and production.schedule_state == '已排': production.state = 'pending_cam' From 1551ea4b1222fb195f53bb5673d84e1f5d57f658 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Mon, 1 Jul 2024 18:17:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=8A=B6=E6=80=81=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 71cd86b5..0fa86e78 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -116,6 +116,11 @@ class MrpProduction(models.Model): elif production.state == 'to_close' and production.schedule_state == '已排': production.state = 'pending_cam' + if production.state == 'progress': + if all(wo_state not in ('progress', 'done') for wo_state in production.workorder_ids.mapped('state')): + production.state = 'pending_cam' + + def action_check(self): """ 审核启用