From bc4806b303875e911ace011c8f45c01f1e0dfd4b Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Sat, 8 Feb 2025 16:47:06 +0800
Subject: [PATCH 1/2] =?UTF-8?q?1=E3=80=81=E9=94=80=E5=94=AE=E8=AE=A2?=
=?UTF-8?q?=E5=8D=95=E8=AF=A6=E6=83=85=E7=95=8C=E9=9D=A2=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9B2=E3=80=81=E5=AE=8C=E6=88=90=20?=
=?UTF-8?q?=E4=BA=BA=E5=B7=A5=E7=BA=BF=E4=B8=8B=E5=8A=A0=E5=B7=A5=E5=88=B6?=
=?UTF-8?q?=E9=80=A0=E8=AE=A2=E5=8D=95=E6=8F=90=E4=BA=A4=E8=BF=94=E5=B7=A5?=
=?UTF-8?q?=E6=97=B6-=E5=BB=BA=E8=AE=AE=E9=9A=90=E8=97=8F=E3=80=90?=
=?UTF-8?q?=E4=BF=9D=E7=95=99=E8=A3=85=E5=A4=B9=E9=A2=84=E8=B0=83=E6=B5=8B?=
=?UTF-8?q?=E9=87=8F=E6=95=B0=E6=8D=AE=E3=80=91=20=E9=9C=80=E6=B1=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_manufacturing/models/mrp_production.py | 1 +
sf_manufacturing/wizard/rework_wizard.py | 1 +
sf_manufacturing/wizard/rework_wizard_views.xml | 3 ++-
sf_sale/views/sale_order_view.xml | 12 ++++++++++++
4 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py
index c8ea012a..740a474f 100644
--- a/sf_manufacturing/models/mrp_production.py
+++ b/sf_manufacturing/models/mrp_production.py
@@ -1257,6 +1257,7 @@ class MrpProduction(models.Model):
'target': 'new',
'context': {
'default_production_id': self.id,
+ 'default_is_clamping': True if self.workorder_ids.filtered(lambda wk: wk.routing_type == '装夹预调') else False,
'default_workorder_ids': workorder_ids.ids if workorder_ids.ids != [] else self.workorder_ids.ids,
'default_hidden_workorder_ids': ','.join(map(str, work_id_list)) if work_id_list != [] else '',
'default_reprogramming_num': cloud_programming.get('reprogramming_num') if cloud_programming else '',
diff --git a/sf_manufacturing/wizard/rework_wizard.py b/sf_manufacturing/wizard/rework_wizard.py
index a3ac96ed..11827819 100644
--- a/sf_manufacturing/wizard/rework_wizard.py
+++ b/sf_manufacturing/wizard/rework_wizard.py
@@ -35,6 +35,7 @@ class ReworkWizard(models.TransientModel):
is_reprogramming = fields.Boolean(string='申请重新编程', default=False)
is_reprogramming_readonly = fields.Boolean(string='申请重新编程(只读)', default=False)
is_clamp_measure = fields.Boolean(string='保留装夹测量数据', default=True)
+ is_clamping = fields.Boolean(string='制造订单是否存在装夹预调工单')
reprogramming_num = fields.Integer('重新编程次数', default=0)
programming_state = fields.Selection(
[('待编程', '待编程'), ('编程中', '编程中'), ('已编程', '已编程'), ('已编程未下发', '已编程未下发'),
diff --git a/sf_manufacturing/wizard/rework_wizard_views.xml b/sf_manufacturing/wizard/rework_wizard_views.xml
index aad8a692..e6c8dea9 100644
--- a/sf_manufacturing/wizard/rework_wizard_views.xml
+++ b/sf_manufacturing/wizard/rework_wizard_views.xml
@@ -13,6 +13,7 @@