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 = {