From 9f3b351544802e3d1d886c09a9dc52ef3d684a44 Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Mon, 30 Dec 2024 15:25:20 +0800 Subject: [PATCH] =?UTF-8?q?sf-=E5=B7=A5=E5=BA=8F=E5=A4=96=E5=8D=8F?= =?UTF-8?q?=E8=B0=83=E6=8B=A8=E5=8D=95-=E5=A4=96=E5=8D=8F=E5=87=BA?= =?UTF-8?q?=E5=BA=93=E5=8D=95=E5=A4=9A=E7=94=9F=E6=88=90=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E5=BC=A0=E5=A4=96=E5=8D=8F=E5=87=BA=E5=BA=93=E8=B0=83=E6=8B=A8?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/purchase_order.py | 2 +- sf_manufacturing/models/sf_technology_design.py | 1 - sf_sale/models/sale_order.py | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sf_manufacturing/models/purchase_order.py b/sf_manufacturing/models/purchase_order.py index 3b1a54f1..fc8a96b1 100644 --- a/sf_manufacturing/models/purchase_order.py +++ b/sf_manufacturing/models/purchase_order.py @@ -45,7 +45,7 @@ class PurchaseOrder(models.Model): purchase.production_count = len(production_id) def button_confirm(self): super().button_confirm() - workorders = self.env['mrp.workorder'].search([('purchase_id', '=', self.id)]) + workorders = self.env['mrp.workorder'].search([('purchase_id', '=', self.id),('state', '!=', 'cancel')]) for workorder in workorders: if workorder.routing_type == '表面工艺' and workorder.is_subcontract is True: move_out = workorder.move_subcontract_workorder_ids[1] diff --git a/sf_manufacturing/models/sf_technology_design.py b/sf_manufacturing/models/sf_technology_design.py index 15d2c22d..826c147d 100644 --- a/sf_manufacturing/models/sf_technology_design.py +++ b/sf_manufacturing/models/sf_technology_design.py @@ -36,7 +36,6 @@ class sf_technology_design(models.Model): return workorders_values_str def write(self, vals): - print('qwfojkqwfkio') return super(sf_technology_design, self).write(vals) def unlink_technology_design(self): self.active = False diff --git a/sf_sale/models/sale_order.py b/sf_sale/models/sale_order.py index c16a2b06..c9c06b9b 100644 --- a/sf_sale/models/sale_order.py +++ b/sf_sale/models/sale_order.py @@ -364,6 +364,7 @@ class RePurchaseOrder(models.Model): purchase_order = pp._get_surface_technics_purchase_ids() if purchase_order: purchase_order.write({'state': 'draft'}) + pp.purchase_id = [(6, 0, [purchase_order.id])] else: server_template = self.env['product.template'].search( [('server_product_process_parameters_id', '=', pp.surface_technics_parameters_id.id),