Skip to content

Commit

Permalink
[FIX] rma_account: default refund journal should respect rma line com…
Browse files Browse the repository at this point in the history
…pany
  • Loading branch information
AaronHForgeFlow committed Aug 8, 2024
1 parent a6ca011 commit 03cd0b3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions rma_account/wizards/rma_refund.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,16 @@ def _prepare_refund(self, wizard, rma_line):
journal = rma_line.operation_id.refund_journal_id
elif rma_line.type == "customer":
journal = self.env["account.journal"].search(
[("type", "=", "sale")], limit=1
[("type", "=", "sale"), ("company_id", "=", rma_line.company_id.id)],
limit=1,
)
else:
journal = self.env["account.journal"].search(
[("type", "=", "purchase")], limit=1
[
("type", "=", "purchase"),
("company_id", "=", rma_line.company_id.id),
],
limit=1,
)
values = {
"payment_reference": rma_line.rma_id.name or rma_line.name,
Expand Down

0 comments on commit 03cd0b3

Please sign in to comment.