[FIX] fix filter rma location based on the sale order company

This commit is contained in:
Sébastien BEAU
2021-10-22 14:29:48 +02:00
committed by Pedro M. Baeza
parent 1b470773f9
commit dfb9c20919
2 changed files with 7 additions and 2 deletions

View File

@@ -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",

View File

@@ -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(