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 @@ + -
+
保留装夹测量数据 diff --git a/sf_sale/views/sale_order_view.xml b/sf_sale/views/sale_order_view.xml index 1c96bf59..24e8f3ef 100644 --- a/sf_sale/views/sale_order_view.xml +++ b/sf_sale/views/sale_order_view.xml @@ -228,6 +228,18 @@ + + sale.order.line.tree.sale.stock.qty.sf + + sale.order + + + + + + + + sale.order.quotation.tree.inherit.sf sale.order From 7a6538bcc116adb40c692a3d3ae6443fc1ff1446 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Wed, 12 Feb 2025 11:29:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AE=8C=E6=88=90=20=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E5=8D=95=E6=8D=AE=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E3=80=90=E9=9C=80=E6=B1=82=E6=95=B0=E9=87=8F=E3=80=91?= =?UTF-8?q?=20=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_warehouse/models/model.py | 11 +++++++++++ sf_warehouse/views/change_stock_move_views.xml | 3 +++ 2 files changed, 14 insertions(+) diff --git a/sf_warehouse/models/model.py b/sf_warehouse/models/model.py index fb80618a..582d7a59 100644 --- a/sf_warehouse/models/model.py +++ b/sf_warehouse/models/model.py @@ -935,6 +935,17 @@ class SfStockPicking(models.Model): _inherit = 'stock.picking' check_in = fields.Char(string='查询是否为入库单', compute='_check_is_in') + product_uom_qty_sp = fields.Float('需求数量', compute='_compute_product_uom_qty_sp', store=True) + + @api.depends('move_ids_without_package', 'move_ids_without_package.product_uom_qty') + def _compute_product_uom_qty_sp(self): + for sp in self: + if sp.move_ids_without_package: + sp.product_uom_qty_sp = 0 + for move_id in sp.move_ids_without_package: + sp.product_uom_qty_sp += move_id.product_uom_qty + else: + sp.product_uom_qty_sp = 0 def batch_stock_move(self): """ diff --git a/sf_warehouse/views/change_stock_move_views.xml b/sf_warehouse/views/change_stock_move_views.xml index 9e1073c9..8cde3ca3 100644 --- a/sf_warehouse/views/change_stock_move_views.xml +++ b/sf_warehouse/views/change_stock_move_views.xml @@ -156,6 +156,9 @@