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 @@
- 注意:该制造订单产品已申请重新编程次数为,且当前编程状态为
+
+
+
+ 注意: 该制造订单产品已申请重新编程次数为,且当前编程状态为
+
+
+