From aafaafb7015e7a236f0f84a1b6c61899fe5f0c5a Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Fri, 21 Jun 2019 14:36:00 +0200 Subject: [PATCH 1/2] [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', From ea66918ddfbf1417e37c5cdcd7a35ae69ab75cc1 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Fri, 21 Jun 2019 14:47:51 +0200 Subject: [PATCH 2/2] make the RMA routes shared in multicompany by default --- rma/data/stock_data.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rma/data/stock_data.xml b/rma/data/stock_data.xml index cf1b7edd..120c3c02 100755 --- a/rma/data/stock_data.xml +++ b/rma/data/stock_data.xml @@ -113,6 +113,7 @@ RMA Customer + 10 @@ -123,6 +124,7 @@ RMA Supplier + 10 @@ -133,6 +135,7 @@ RMA Dropship + 10