diff --git a/rma/models/res_partner.py b/rma/models/res_partner.py index 4fad21cc..0a263d4f 100644 --- a/rma/models/res_partner.py +++ b/rma/models/res_partner.py @@ -18,6 +18,6 @@ class ResPartner(models.Model): def action_open_partner_rma(self): action = self.env.ref("rma.action_rma_customer_lines") - result = action.read()[0] + result = action.sudo().read()[0] result["context"] = {"search_default_partner_id": self.id} return result diff --git a/rma/models/rma_order.py b/rma/models/rma_order.py index e3774075..0439ac06 100644 --- a/rma/models/rma_order.py +++ b/rma/models/rma_order.py @@ -185,7 +185,7 @@ class RmaOrder(models.Model): def action_view_in_shipments(self): action = self.env.ref("stock.action_picking_tree_all") - result = action.read()[0] + result = action.sudo().read()[0] picking_ids = [] for line in self.rma_line_ids: for move in line.move_ids: @@ -207,7 +207,7 @@ class RmaOrder(models.Model): def action_view_out_shipments(self): action = self.env.ref("stock.action_picking_tree_all") - result = action.read()[0] + result = action.sudo().read()[0] picking_ids = [] for line in self.rma_line_ids: for move in line.move_ids: @@ -237,7 +237,7 @@ class RmaOrder(models.Model): else: action = self.env.ref("rma.action_rma_supplier_lines") res = self.env.ref("rma.view_rma_line_supplier_form", False) - result = action.read()[0] + result = action.sudo().read()[0] lines = self._get_valid_lines() # choose the view_mode accordingly if len(lines.ids) != 1: @@ -250,7 +250,7 @@ class RmaOrder(models.Model): def action_view_supplier_lines(self): action = self.env.ref("rma.action_rma_supplier_lines") - result = action.read()[0] + result = action.sudo().read()[0] lines = self.rma_line_ids for line_id in lines: related_lines = [line.id for line in line_id.supplier_rma_line_ids] diff --git a/rma/models/rma_order_line.py b/rma/models/rma_order_line.py index cdc3d41f..71231cc8 100644 --- a/rma/models/rma_order_line.py +++ b/rma/models/rma_order_line.py @@ -667,7 +667,7 @@ class RmaOrderLine(models.Model): def action_view_in_shipments(self): action = self.env.ref("stock.action_picking_tree_all") - result = action.read()[0] + result = action.sudo().read()[0] picking_ids = [] for line in self: for move in line.move_ids: @@ -689,7 +689,7 @@ class RmaOrderLine(models.Model): def action_view_out_shipments(self): action = self.env.ref("stock.action_picking_tree_all") - result = action.read()[0] + result = action.sudo().read()[0] picking_ids = [] for line in self: for move in line.move_ids: @@ -717,7 +717,7 @@ class RmaOrderLine(models.Model): action = self.env.ref("rma.action_rma_customer_lines") rma_lines = self.customer_rma_id.ids res = self.env.ref("rma.view_rma_line_form", False) - result = action.read()[0] + result = action.sudo().read()[0] # choose the view_mode accordingly if rma_lines and len(rma_lines) != 1: result["domain"] = rma_lines.ids diff --git a/rma/wizards/rma_order_line_make_supplier_rma.py b/rma/wizards/rma_order_line_make_supplier_rma.py index 37672f66..7845cfb9 100644 --- a/rma/wizards/rma_order_line_make_supplier_rma.py +++ b/rma/wizards/rma_order_line_make_supplier_rma.py @@ -160,7 +160,7 @@ class RmaLineMakeSupplierRma(models.TransientModel): rma_line_obj.create(rma_line_data) action = self.env.ref("rma.action_rma_supplier_lines") rma_lines = self.item_ids.mapped("line_id.supplier_rma_line_ids").ids - result = action.read()[0] + result = action.sudo().read()[0] result["domain"] = [("id", "in", rma_lines)] return result