Skip to content

Commit

Permalink
[16.0][FIX] account_invoice_refund_link: fix erroneous invoice-refund…
Browse files Browse the repository at this point in the history
… link

The current implementation creates incorrect links between refund lines and their origin invoice lines. This patch fixes it. It's a very small and obvious change so it should be easy to review and merge.
  • Loading branch information
Pedro Castro Silva authored Feb 27, 2023
1 parent 912028e commit c9190bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion account_invoice_refund_link/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def _reverse_moves(self, default_values_list=None, cancel=False):
refund_lines = move.line_ids.filtered(
lambda x: x.display_type == "product"
)
for i, line in enumerate(self.invoice_line_ids):
for i, line in enumerate(self.invoice_line_ids.filtered(
lambda x: x.display_type == "product")):
if i < len(refund_lines):
refund_lines[i].origin_line_id = line.id
return reverse_moves

0 comments on commit c9190bd

Please sign in to comment.