[FIX] stock_location_tray: fix permission on act_window in v14

This commit is contained in:
Florent Xicluna
2021-12-09 11:19:27 +01:00
parent 2ba4a3f301
commit 274ecfa506
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}