From dfb9c2091938a429cb5a72830a6af30fa4f2108a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BEAU?= Date: Fri, 22 Oct 2021 14:29:48 +0200 Subject: [PATCH] [FIX] fix filter rma location based on the sale order company --- rma_sale/__manifest__.py | 2 +- rma_sale/wizard/sale_order_rma_wizard.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/rma_sale/__manifest__.py b/rma_sale/__manifest__.py index 0e0f628d..6373270d 100644 --- a/rma_sale/__manifest__.py +++ b/rma_sale/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Return Merchandise Authorization Management - Link with Sales", "summary": "Sale Order - Return Merchandise Authorization (RMA)", - "version": "14.0.1.0.0", + "version": "14.0.1.0.1", "development_status": "Production/Stable", "category": "RMA", "website": "https://github.com/OCA/rma", diff --git a/rma_sale/wizard/sale_order_rma_wizard.py b/rma_sale/wizard/sale_order_rma_wizard.py index 2ad8274b..f129c818 100644 --- a/rma_sale/wizard/sale_order_rma_wizard.py +++ b/rma_sale/wizard/sale_order_rma_wizard.py @@ -9,7 +9,12 @@ class SaleOrderRmaWizard(models.TransientModel): _description = "Sale Order Rma Wizard" def _domain_location_id(self): - rma_loc = self.env["stock.warehouse"].search([]).mapped("rma_loc_id") + sale = self.env["sale.order"].browse(self.env.context.get("active_id")) + rma_loc = ( + self.env["stock.warehouse"] + .search([("company_id", "=", sale.company_id.id)]) + .mapped("rma_loc_id") + ) return [("id", "child_of", rma_loc.ids)] order_id = fields.Many2one(