From fc41f3024442a1edba21956e896d198571a5c4c6 Mon Sep 17 00:00:00 2001 From: guanhuan Date: Wed, 4 Jun 2025 17:31:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AA=E9=BD=90=E5=A5=97=E6=8F=90=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 | 4 ++-- 1 file changed, 2 insertions(+), 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 155c64d6..f50d05e5 100644 --- a/sf_demand_plan/models/sf_production_demand_plan.py +++ b/sf_demand_plan/models/sf_production_demand_plan.py @@ -380,7 +380,7 @@ class sf_production_plan(models.Model): if line.product_id in raw_materials ) record.hide_action_purchase_orders = total_purchase_quantity < record.product_uom_qty and pr_ids.state != 'done' - elif record.supply_method == 'purchase': + elif record.supply_method in ('purchase', 'outsourcing'): purchase_orders = self.env['purchase.order'].sudo().search([ ('state', 'in', ('purchase', 'done')), ('order_line.product_id', '=', record.product_id.id) @@ -443,7 +443,7 @@ class sf_production_plan(models.Model): first_mp = self.env['mrp.production'].search( [('origin', '=', self.sale_order_id.name)], limit=1, order='id asc') domain = [('origin', 'like', first_mp.name)] - elif self.supply_method == 'purchase': + elif self.supply_method in ('purchase', 'outsourcing'): domain = [('origin', 'like', self.sale_order_id.name)] pr_ids = self.env['purchase.request'].sudo().search(domain) action = {