From d92505acb82054e0bf1a89964ef84c7bd1ba2fd6 Mon Sep 17 00:00:00 2001 From: Lois Rilo Date: Fri, 16 Apr 2021 13:07:38 +0200 Subject: [PATCH] [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. --- rma_repair/models/rma_order.py | 2 +- rma_repair/models/rma_order_line.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rma_repair/models/rma_order.py b/rma_repair/models/rma_order.py index 6e24b994..08440e88 100644 --- a/rma_repair/models/rma_order.py +++ b/rma_repair/models/rma_order.py @@ -18,7 +18,7 @@ class RmaOrder(models.Model): def action_view_repair_order(self): 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 result["domain"] = [("id", "in", repair_ids)] return result diff --git a/rma_repair/models/rma_order_line.py b/rma_repair/models/rma_order_line.py index dd8922d1..0b911b92 100644 --- a/rma_repair/models/rma_order_line.py +++ b/rma_repair/models/rma_order_line.py @@ -120,7 +120,7 @@ class RmaOrderLine(models.Model): def action_view_repair_order(self): action = self.env.ref("repair.action_repair_order_tree") - result = action.read()[0] + result = action.sudo().read()[0] repair_ids = self.repair_ids.ids if len(repair_ids) != 1: result["domain"] = [("id", "in", repair_ids)]