From 40603fea6a101cd131800a29811e47c77e2eecb8 Mon Sep 17 00:00:00 2001
From: mgw <1392924357@qq.com>
Date: Tue, 14 Jan 2025 11:12:07 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BC=96=E7=A8=8B=E8=AE=B0?=
=?UTF-8?q?=E5=BD=95=E7=94=9F=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../wizard/sf_programming_reason.py | 5 +-
.../wizard/sf_programming_reason_views.xml | 13 ++++-
sf_mrs_connect/controllers/controllers.py | 58 +++++++++++++++++--
3 files changed, 67 insertions(+), 9 deletions(-)
diff --git a/sf_manufacturing/wizard/sf_programming_reason.py b/sf_manufacturing/wizard/sf_programming_reason.py
index d6744bed..d4126937 100644
--- a/sf_manufacturing/wizard/sf_programming_reason.py
+++ b/sf_manufacturing/wizard/sf_programming_reason.py
@@ -15,7 +15,8 @@ class sf_programming_reason(models.TransientModel):
if self._context.get('active_id'):
production = self.env['mrp.production'].browse(self._context.get('active_id'))
res.update({
- 'reprogramming_count': production._cron_get_programming_state()['reprogramming_num'],
+ 'reprogramming_count': production._cron_get_programming_state()['reprogramming_num'] if
+ production._cron_get_programming_state().get('reprogramming_num') else 0,
'programming_state': production.programming_state, # 假设制造订单模型中有这个字段
})
return res
@@ -33,7 +34,7 @@ class sf_programming_reason(models.TransientModel):
'reason': self.reason,
'programming_method': cloud_programming['programme_way'],
'current_programming_count': cloud_programming['reprogramming_num'],
- 'target_production_id': cloud_programming['production_order_no'],
+ 'target_production_id': self.production_id.name,
'apply_time': self._context.get('default_apply_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 02193bf6..7af0af7f 100644
--- a/sf_manufacturing/wizard/sf_programming_reason_views.xml
+++ b/sf_manufacturing/wizard/sf_programming_reason_views.xml
@@ -8,8 +8,19 @@
- 注意:该制造订单产品已申请重新编程次数为,且当前编程状态为
+
+
+
+ 注意: 该制造订单产品已申请重新编程次数为,且当前编程状态为
+
+
+