From 34bbff9acf463c718395f5e926be65c8f151cf40 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 099069a8a..7a4b8d4bf 100644 --- a/mrp_multi_level/models/product_mrp_area.py +++ b/mrp_multi_level/models/product_mrp_area.py @@ -178,7 +178,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"