From 6b6f091da87b41b31ff98607bef34f263253c1ac Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Mon, 13 Jan 2025 11:11:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=BC=96=E7=A8=8B=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/wizard/sf_programming_reason.py | 2 +- sf_manufacturing/wizard/sf_programming_reason_views.xml | 7 ++++--- sf_mrs_connect/controllers/controllers.py | 7 +++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/sf_manufacturing/wizard/sf_programming_reason.py b/sf_manufacturing/wizard/sf_programming_reason.py index 5e7ec706..d6744bed 100644 --- a/sf_manufacturing/wizard/sf_programming_reason.py +++ b/sf_manufacturing/wizard/sf_programming_reason.py @@ -35,7 +35,7 @@ class sf_programming_reason(models.TransientModel): 'current_programming_count': cloud_programming['reprogramming_num'], 'target_production_id': cloud_programming['production_order_no'], 'apply_time': self._context.get('default_apply_time'), - 'send_time': cloud_programming['send_time'], + 'send_time': False, }) # 返回弹窗提示“已下达编程任务和消息,请等待编程单下发” diff --git a/sf_manufacturing/wizard/sf_programming_reason_views.xml b/sf_manufacturing/wizard/sf_programming_reason_views.xml index 5b9e15a8..02193bf6 100644 --- a/sf_manufacturing/wizard/sf_programming_reason_views.xml +++ b/sf_manufacturing/wizard/sf_programming_reason_views.xml @@ -25,10 +25,11 @@

已下达编程任务和消息,请等待编程单下发!

+
+
- +
diff --git a/sf_mrs_connect/controllers/controllers.py b/sf_mrs_connect/controllers/controllers.py index 5506e7f6..186cc7a5 100644 --- a/sf_mrs_connect/controllers/controllers.py +++ b/sf_mrs_connect/controllers/controllers.py @@ -100,6 +100,9 @@ class Sf_Mrs_Connect(http.Controller, MultiInheritController): # 更新编程记录 for production in productions: + record_ids_obj = production.programming_record_ids.filtered(lambda r: r.current_programming_count == ret['reprogramming_num']) + if record_ids_obj: + record_ids_obj.write({'send_time': ret['send_time']}) if ret['reprogramming_num'] == 0: production.programming_record_ids.create({ 'number': 1, @@ -108,7 +111,7 @@ class Sf_Mrs_Connect(http.Controller, MultiInheritController): 'programming_method': ret['programme_way'], 'current_programming_count': ret['reprogramming_num'], 'target_production_id': ret['production_order_no'], - 'apply_time': '', + 'apply_time': False, 'send_time': ret['send_time'], }) if ret['reset_flag']: @@ -119,7 +122,7 @@ class Sf_Mrs_Connect(http.Controller, MultiInheritController): 'programming_method': ret['programme_way'], 'current_programming_count': ret['reprogramming_num'], 'target_production_id': ret['production_order_no'], - 'apply_time': '', + 'apply_time': False, 'send_time': ret['send_time'], })