mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user