From 8ead5655cf30faf2dca1c934a73c0525272eb8a0 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Thu, 29 Aug 2024 15:23:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=96=E5=8D=8F=E9=87=87?= =?UTF-8?q?=E8=B4=AD?= 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 485eb290..d6a5ea9f 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -966,12 +966,14 @@ class ResMrpWorkOrder(models.Model): else: production_programming = self.env['mrp.production'].search( [('programming_no', '=', self.production_id.programming_no)], order='name asc') + production_no_remanufacture = production_programming.filtered( + lambda a: a.is_remanufacture is False) production_list = [production.name for production in production_programming] purchase_orders = self.env['purchase.order'].search( - [('origin', '=', ','.join(production_list))]) + [('origin', 'ilike', ','.join(production_list))]) for line in purchase_orders.order_line: if line.product_id.server_product_process_parameters_id == workorder.surface_technics_parameters_id and line.product_qty == len( - production_programming): + production_no_remanufacture): if purchase_orders.state == 'purchase': workorder.state = 'ready' else: