Skip to content

Commit

Permalink
[IMP] account_reconcile_widget: Allow to reconcile payment/debit orde…
Browse files Browse the repository at this point in the history
…rs from OCA/bank-payment

Payments without payment_id related aren't showed in statement
reconciliation.

With this change, we show them as blue lines, the same as other coming
from Odoo core payments.

TT34508
  • Loading branch information
pedrobaeza committed Mar 11, 2022
1 parent ae2ff11 commit 7c98fd8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion account_reconciliation_widget/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "account_reconciliation_widget",
"version": "15.0.1.1.1",
"version": "15.0.1.1.2",
"category": "Accounting",
"license": "AGPL-3",
"summary": "Account reconciliation widget",
Expand Down
30 changes: 13 additions & 17 deletions account_reconciliation_widget/models/reconciliation_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,15 +770,25 @@ def _domain_move_lines_for_reconciliation(
excluded_ids.extend(to_check_excluded)

domain_reconciliation = [
"&",
"&",
"&",
("statement_line_id", "=", False),
("account_id", "in", aml_accounts),
("payment_id", "<>", False),
("balance", "!=", 0.0),
]

if st_line.company_id.account_bank_reconciliation_start:
domain_reconciliation = expression.AND(
[
domain_reconciliation,
[
(
"date",
">=",
st_line.company_id.account_bank_reconciliation_start,
)
],
]
)
# default domain matching
domain_matching = [
"&",
Expand Down Expand Up @@ -831,20 +841,6 @@ def _domain_move_lines_for_reconciliation(
# filter on account.move.line having the same company as the statement
# line
domain = expression.AND([domain, [("company_id", "=", st_line.company_id.id)]])

if st_line.company_id.account_bank_reconciliation_start:
domain = expression.AND(
[
domain,
[
(
"date",
">=",
st_line.company_id.account_bank_reconciliation_start,
)
],
]
)
return domain

@api.model
Expand Down

0 comments on commit 7c98fd8

Please sign in to comment.