[14.0][MIG] rma*: ir.actions.act_window has different access

right in v14. Actions that read those records need to use
`sudo` to allow non-admin users to be able to use these actions.
This commit is contained in:
Lois Rilo
2021-04-16 13:07:38 +02:00
committed by JasminSForgeFlow
parent e3ad38147e
commit 552c9432f5
2 changed files with 2 additions and 2 deletions

View File

@@ -18,7 +18,7 @@ class RmaOrder(models.Model):
def action_view_repair_order(self): def action_view_repair_order(self):
action = self.env.ref("repair.action_repair_order_tree") action = self.env.ref("repair.action_repair_order_tree")
result = action.read()[0] result = action.sudo().read()[0]
repair_ids = self.mapped("rma_line_ids.repair_ids").ids repair_ids = self.mapped("rma_line_ids.repair_ids").ids
result["domain"] = [("id", "in", repair_ids)] result["domain"] = [("id", "in", repair_ids)]
return result return result

View File

@@ -120,7 +120,7 @@ class RmaOrderLine(models.Model):
def action_view_repair_order(self): def action_view_repair_order(self):
action = self.env.ref("repair.action_repair_order_tree") action = self.env.ref("repair.action_repair_order_tree")
result = action.read()[0] result = action.sudo().read()[0]
repair_ids = self.repair_ids.ids repair_ids = self.repair_ids.ids
if len(repair_ids) != 1: if len(repair_ids) != 1:
result["domain"] = [("id", "in", repair_ids)] result["domain"] = [("id", "in", repair_ids)]