From 854cd2d0d7ada486c567cff68845a963c3e70c9f 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/wizard/sale_order_rma_wizard.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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(