From 2c7fbd3aef99cb6f90413118f82fbd06b3420051 Mon Sep 17 00:00:00 2001 From: guanhuan Date: Fri, 13 Jun 2025 10:41:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9D=AF=E6=96=99=E7=9A=84?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E7=94=B3=E8=AF=B7=E6=8C=89=E9=92=AE=E6=B2=A1?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_demand_plan/models/sf_production_demand_plan.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sf_demand_plan/models/sf_production_demand_plan.py b/sf_demand_plan/models/sf_production_demand_plan.py index de902573..d484fb8e 100644 --- a/sf_demand_plan/models/sf_production_demand_plan.py +++ b/sf_demand_plan/models/sf_production_demand_plan.py @@ -363,10 +363,9 @@ class SfProductionDemandPlan(models.Model): ) if total_purchase_quantity < record.product_uom_qty: pr_ids = self.env['purchase.request'].sudo().search( - [('origin', 'like', mrp_production[0].name), ('state', '!=', 'done')]) + [('line_ids.product_id', 'in', raw_materials.ids), ('state', '!=', 'done')]) outsourcing_purchase_request.extend(pr_ids.ids) elif record.supply_method in ('purchase', 'outsourcing'): - pr_ids = None purchase_orders = self.env['purchase.order'].sudo().search([ ('state', 'in', ('purchase', 'done')), ('order_line.product_id', '=', record.product_id.id)