mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
[FIX] multi company error on rma location choice
This commit is contained in:
committed by
Pedro M. Baeza
parent
18d9eacece
commit
e3750a31e4
@@ -3,7 +3,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Return Merchandise Authorization Management",
|
"name": "Return Merchandise Authorization Management",
|
||||||
"summary": "Return Merchandise Authorization (RMA)",
|
"summary": "Return Merchandise Authorization (RMA)",
|
||||||
"version": "14.0.1.0.2",
|
"version": "14.0.1.0.3",
|
||||||
"development_status": "Production/Stable",
|
"development_status": "Production/Stable",
|
||||||
"category": "RMA",
|
"category": "RMA",
|
||||||
"website": "https://github.com/OCA/rma",
|
"website": "https://github.com/OCA/rma",
|
||||||
|
|||||||
@@ -18,7 +18,14 @@ class Rma(models.Model):
|
|||||||
_inherit = ["mail.thread", "portal.mixin", "mail.activity.mixin"]
|
_inherit = ["mail.thread", "portal.mixin", "mail.activity.mixin"]
|
||||||
|
|
||||||
def _domain_location_id(self):
|
def _domain_location_id(self):
|
||||||
rma_loc = self.env["stock.warehouse"].search([]).mapped("rma_loc_id")
|
# this is done with sudo, intercompany rules are not applied by default so we
|
||||||
|
# add company in domain explicitly to avoid multi-company rule error when
|
||||||
|
# the user will try to choose a location
|
||||||
|
rma_loc = (
|
||||||
|
self.env["stock.warehouse"]
|
||||||
|
.search([("company_id", "in", self.env.companies.ids)])
|
||||||
|
.mapped("rma_loc_id")
|
||||||
|
)
|
||||||
return [("id", "child_of", rma_loc.ids)]
|
return [("id", "child_of", rma_loc.ids)]
|
||||||
|
|
||||||
# General fields
|
# General fields
|
||||||
|
|||||||
Reference in New Issue
Block a user