From c5757a238675adbced3bd79e22eebe184ea367a5 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Fri, 21 Jun 2019 14:36:00 +0200 Subject: [PATCH] [FIX] wrong company on stock rules when working with odoobot account, you would get the wrong company_id on the RMA stock.rules of the warehouse on which you enabled RMA --- rma/models/stock_warehouse.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rma/models/stock_warehouse.py b/rma/models/stock_warehouse.py index b5d92432..35bc9488 100644 --- a/rma/models/stock_warehouse.py +++ b/rma/models/stock_warehouse.py @@ -174,13 +174,13 @@ class StockWarehouse(models.Model): self.ensure_one() rma_rules = dict() customer_loc, supplier_loc = self._get_partner_locations() - # TODO: company_id? rma_rules['rma_customer_in'] = { 'name': self._format_rulename(self, customer_loc, self.lot_rma_id.name), 'action': 'pull', 'warehouse_id': self.id, + 'company_id': self.company_id.id, 'location_src_id': customer_loc.id, 'location_id': self.lot_rma_id.id, 'procure_method': 'make_to_stock', @@ -194,6 +194,7 @@ class StockWarehouse(models.Model): customer_loc.name), 'action': 'pull', 'warehouse_id': self.id, + 'company_id': self.company_id.id, 'location_src_id': self.lot_rma_id.id, 'location_id': customer_loc.id, 'procure_method': 'make_to_stock', @@ -207,6 +208,7 @@ class StockWarehouse(models.Model): self.lot_rma_id.name), 'action': 'pull', 'warehouse_id': self.id, + 'company_id': self.company_id.id, 'location_src_id': supplier_loc.id, 'location_id': self.lot_rma_id.id, 'procure_method': 'make_to_stock', @@ -220,6 +222,7 @@ class StockWarehouse(models.Model): supplier_loc.name), 'action': 'pull', 'warehouse_id': self.id, + 'company_id': self.company_id.id, 'location_src_id': self.lot_rma_id.id, 'location_id': supplier_loc.id, 'procure_method': 'make_to_stock',