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:
committed by
JasminSForgeFlow
parent
c3d9803241
commit
4d63063a30
@@ -32,7 +32,7 @@ class RmaOrder(models.Model):
|
||||
|
||||
def action_view_sale_order(self):
|
||||
action = self.env.ref("sale.action_quotations")
|
||||
result = action.read()[0]
|
||||
result = action.sudo().read()[0]
|
||||
so_ids = self.mapped("rma_line_ids.sale_line_id.order_id").ids
|
||||
result["domain"] = [("id", "in", so_ids)]
|
||||
return result
|
||||
|
||||
@@ -199,7 +199,7 @@ class RmaOrderLine(models.Model):
|
||||
|
||||
def action_view_sale_order(self):
|
||||
action = self.env.ref("sale.action_quotations")
|
||||
result = action.read()[0]
|
||||
result = action.sudo().read()[0]
|
||||
order_ids = self.mapped("sale_line_ids.order_id").ids
|
||||
result["domain"] = [("id", "in", order_ids)]
|
||||
return result
|
||||
|
||||
@@ -23,7 +23,7 @@ class SaleOrder(models.Model):
|
||||
|
||||
def action_view_rma(self):
|
||||
action = self.env.ref("rma.action_rma_customer_lines")
|
||||
result = action.read()[0]
|
||||
result = action.sudo().read()[0]
|
||||
rma_ids = self.mapped("rma_line_ids").ids
|
||||
if rma_ids:
|
||||
# choose the view_mode accordingly
|
||||
|
||||
@@ -119,7 +119,7 @@ class RmaLineMakeSaleOrder(models.TransientModel):
|
||||
res.append(sale.id)
|
||||
|
||||
action = self.env.ref("sale.action_orders")
|
||||
result = action.read()[0]
|
||||
result = action.sudo().read()[0]
|
||||
result["domain"] = "[('id','in', [" + ",".join(map(str, res)) + "])]"
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user