diff --git a/rma_account/models/account_move.py b/rma_account/models/account_move.py index 602b0542..5bc0e1fc 100644 --- a/rma_account/models/account_move.py +++ b/rma_account/models/account_move.py @@ -64,7 +64,7 @@ class AccountMove(models.Model): def action_view_rma_supplier(self): action = self.env.ref("rma.action_rma_supplier_lines") - result = action.read()[0] + result = action.sudo().read()[0] rma_ids = self.mapped("line_ids.rma_line_ids").ids if rma_ids: # choose the view_mode accordingly @@ -78,7 +78,7 @@ class AccountMove(models.Model): def action_view_rma_customer(self): action = self.env.ref("rma.action_rma_customer_lines") - result = action.read()[0] + result = action.sudo().read()[0] rma_ids = self.mapped("line_ids.rma_line_ids").ids if rma_ids: # choose the view_mode accordingly diff --git a/rma_account/wizards/rma_refund.py b/rma_account/wizards/rma_refund.py index 7a2553f2..eccc6077 100644 --- a/rma_account/wizards/rma_refund.py +++ b/rma_account/wizards/rma_refund.py @@ -98,7 +98,7 @@ class RmaRefund(models.TransientModel): if (new_invoice.move_type in ["out_refund", "out_invoice"]) else "action_move_in_refund_type" ) - result = self.env.ref("account.%s" % action).read()[0] + result = self.env.ref("account.%s" % action).sudo().read()[0] form_view = self.env.ref("account.move_supplier_form", False) result["views"] = [(form_view and form_view.id or False, "form")] result["res_id"] = new_invoice.id