Merge PR #1325 into 14.0

Signed-off-by sebalix
This commit is contained in:
OCA-git-bot
2021-12-09 11:39:48 +00:00
2 changed files with 6 additions and 2 deletions

View File

@@ -82,7 +82,9 @@ class StockLocation(models.Model):
)
location.ensure_one()
view = self.env.ref("stock.view_location_form")
action = self.env.ref("stock.action_location_form").read()[0]
action = self.env["ir.actions.act_window"]._for_xml_id(
"stock.action_location_form"
)
action.update(
{
"res_id": location.id,

View File

@@ -106,7 +106,9 @@ class StockLocationTrayType(models.Model):
)
def open_locations(self):
action = self.env.ref("stock.action_location_form").read()[0]
action = self.env["ir.actions.act_window"]._for_xml_id(
"stock.action_location_form"
)
action["domain"] = [("tray_type_id", "in", self.ids)]
if len(self.ids) == 1:
action["context"] = {"default_tray_type_id": self.id}