Skip to content

Commit

Permalink
[REF] account_reconcile_payment_order: Adapt module to native payment…
Browse files Browse the repository at this point in the history
… refactoring

Following OCA/bank-payment#979
  • Loading branch information
pedrobaeza authored and ernesto-garcia-tecnativa committed May 4, 2023
1 parent 63d87f1 commit 1ffdf5e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion account_reconcile_payment_order/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{
"name": "Reconcile payment orders",
"version": "14.0.1.0.0",
"version": "14.0.2.0.0",
"author": "Therp BV, Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/account-reconcile",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ def _get_possible_payment_orders_for_statement_line(self, st_line):
def _get_reconcile_lines_from_order(self, st_line, order, excluded_ids=None):
"""Return lines to reconcile our statement line with."""
aml_obj = self.env["account.move.line"]
reconciled_lines = aml_obj.search(
[("bank_payment_line_id", "in", order.bank_line_ids.ids)]
lines = aml_obj
for payment in order.payment_ids:
lines |= payment.move_id.line_ids.filtered(
lambda x: x.account_id != payment.destination_account_id
and x.partner_id == payment.partner_id
)
return (lines - aml_obj.browse(excluded_ids)).filtered(
lambda x: not x.reconciled
)
return (
reconciled_lines.mapped("move_id.line_ids")
- reconciled_lines
- aml_obj.browse(excluded_ids)
).filtered(lambda x: not x.reconciled)

def _prepare_proposition_from_orders(self, st_line, orders, excluded_ids=None):
"""Fill with the expected format the reconciliation proposition
Expand Down

0 comments on commit 1ffdf5e

Please sign in to comment.