Skip to content

Commit

Permalink
Merge pull request #548 from ForgeFlow/17.0-fp-545
Browse files Browse the repository at this point in the history
[17.0][FIX] rma: fix action that opens related RMA or RTV.
  • Loading branch information
DavidJForgeFlow authored Sep 30, 2024
2 parents 62a51f1 + 203a507 commit 148efc0
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 @@ -783,20 +783,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 148efc0

Please sign in to comment.