Skip to content
Permalink
Browse files

[IMP] account: add method to get payments

closes #36228

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
  • Loading branch information...
jco-odoo committed Aug 29, 2019
1 parent eef4881 commit 16c1abf339189ba75ab49f9507c1637aecbd4a06
Showing with 7 additions and 0 deletions.
  1. +7 −0 addons/account/models/account_move.py
@@ -1715,6 +1715,13 @@ def _get_cash_basis_matched_percentage(self):
else:
return abs(total_reconciled / total_amount)

def _get_reconciled_payments(self):
"""Helper used to retrieve the reconciled payments on this journal entry"""
pay_term_line_ids = self.line_ids.filtered(lambda line: line.account_id.user_type_id.type in ('receivable', 'payable'))
reconciled_amls = pay_term_line_ids.mapped('matched_debit_ids.debit_move_id') + \
pay_term_line_ids.mapped('matched_credit_ids.credit_move_id')
return reconciled_amls.mapped('payment_id')

@api.multi
def _reverse_move_vals(self, default_values, cancel=True):
''' Reverse values passed as parameter being the copied values of the original journal entry.

0 comments on commit 16c1abf

Please sign in to comment.
You can’t perform that action at this time.