[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
parent 03763a2755
commit 9838954f73
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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