Skip to content

Commit

Permalink
[FIX] rma: fix action that opens related RMA or RTV.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidJForgeFlow committed Sep 30, 2024
1 parent 10ccdab commit 132b917
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rma/models/rma_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,20 +804,20 @@ def action_view_rma_lines(self):
if self.type == "customer":
# from customer we link to supplier rma
action = self.env.ref("rma.action_rma_supplier_lines")
rma_lines = self.supplier_rma_line_ids.ids
rma_lines = self.supplier_rma_line_ids
res = self.env.ref("rma.view_rma_line_supplier_form", False)
else:
# from supplier we link to customer rma
action = self.env.ref("rma.action_rma_customer_lines")
rma_lines = self.customer_rma_id.ids
rma_lines = self.customer_rma_id
res = self.env.ref("rma.view_rma_line_form", False)
result = action.sudo().read()[0]
# choose the view_mode accordingly
if rma_lines and len(rma_lines) != 1:
result["domain"] = rma_lines.ids
result["domain"] = [('id', 'in', rma_lines.ids)]
elif len(rma_lines) == 1:
result["views"] = [(res and res.id or False, "form")]
result["res_id"] = rma_lines[0]
result["res_id"] = rma_lines.id
return result

@api.constrains("partner_id", "rma_id")
Expand Down

0 comments on commit 132b917

Please sign in to comment.