Skip to content

Commit

Permalink
[IMP]account_payment_group:order imputed invoices by date maturity on…
Browse files Browse the repository at this point in the history
… receipts

Ticket: 51784
  • Loading branch information
Pablo Montenegro authored and pablohmontenegro committed Nov 22, 2022
1 parent fb8d390 commit 623dc94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion account_payment_group/models/account_payment_group.py
Expand Up @@ -363,7 +363,7 @@ def _compute_matched_move_line_ids(self):
"""
for rec in self:
payment_lines = rec.payment_ids.mapped('move_line_ids').filtered(lambda x: x.account_internal_type in ['receivable', 'payable'])
rec.matched_move_line_ids = (payment_lines.mapped('matched_debit_ids.debit_move_id') | payment_lines.mapped('matched_credit_ids.credit_move_id')) - payment_lines
rec.matched_move_line_ids = (payment_lines.mapped('matched_debit_ids.debit_move_id').sorted(key=lambda x: x.date_maturity) | payment_lines.mapped('matched_credit_ids.credit_move_id')).sorted(key=lambda x: x.date_maturity) - payment_lines

@api.depends('payment_ids.move_line_ids')
def _compute_move_lines(self):
Expand Down

0 comments on commit 623dc94

Please sign in to comment.