From d6afd556d3e62b08f99010a225e3b714d1331a24 Mon Sep 17 00:00:00 2001 From: guanhuan Date: Tue, 3 Dec 2024 15:59:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=A2=E4=BB=B7=E5=8D=95=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_workorder.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index 4ea08f94..2f36ad79 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -283,7 +283,8 @@ class ResMrpWorkOrder(models.Model): # if technology_design.is_auto is False: # domain = [('origin', '=', order.production_id.name)] # else: - domain = [('purchase_type', '=', 'consignment'), ('origin', '=', order.production_id.name)] + domain = [('purchase_type', '=', 'consignment'), ('origin', '=', order.production_id.name), + ('state', '!=', 'cancel')] purchase = self.env['purchase.order'].search(domain) purchase_num = 0 if not purchase: @@ -313,7 +314,8 @@ class ResMrpWorkOrder(models.Model): # if technology_design.is_auto is False: # domain = [('origin', '=', self.production_id.name)] # else: - domain = [('origin', '=', self.production_id.name), ('purchase_type', '=', 'consignment')] + domain = [('origin', '=', self.production_id.name), ('purchase_type', '=', 'consignment'), + ('state', '!=', 'cancel')] purchase_orders = self.env['purchase.order'].search(domain) purchase_orders_id = None for po in purchase_orders: