From c22ee1fea9f82ce3208b408eb49d46cf42601abf Mon Sep 17 00:00:00 2001 From: Bernat Puig Font Date: Mon, 21 Feb 2022 10:43:42 +0100 Subject: [PATCH] [14.0][FIX] mrp_multi_level: Get mrp_area company_id for supply method Change from self.env.company to mrp_area_id.company_id to compute the supply method correctly in the area currently working. --- mrp_multi_level/models/product_mrp_area.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mrp_multi_level/models/product_mrp_area.py b/mrp_multi_level/models/product_mrp_area.py index b42d123f5..23f275b7f 100644 --- a/mrp_multi_level/models/product_mrp_area.py +++ b/mrp_multi_level/models/product_mrp_area.py @@ -179,7 +179,7 @@ class ProductMRPArea(models.Model): proc_loc = rec.location_proc_id or rec.mrp_area_id.location_id values = { "warehouse_id": rec.mrp_area_id.warehouse_id, - "company_id": self.env.company, + "company_id": rec.mrp_area_id.company_id, } rule = group_obj._get_rule(rec.product_id, proc_loc, values) rec.supply_method = rule.action if rule else "none"