Skip to content

Commit

Permalink
[FIX] account: reconciliation widget partner domain all reconcile acc…
Browse files Browse the repository at this point in the history
…ounts

Have an account move which lines have all the same partner
Have a bank statement, without a partner
Enter the reconciliation widget for the bank statement
All the lines appear

Select one of the lines of the account move for the partner

Before this commit, all other lines disappeared from the proposition
including the ones for the partner selected
This cas because when having set a partner on the widget,
only receivables and payables accounts were searched for

After this commit, all account move lines for the partner are searched for

OPW 1942936

closes #31488

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
  • Loading branch information
kebeclibre committed Feb 28, 2019
1 parent 72e7976 commit 645d9dc
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions addons/account/models/reconciliation_widget.py
Expand Up @@ -455,21 +455,12 @@ def _domain_move_lines_for_reconciliation(self, st_line, aml_accounts, partner_i
('payment_id', '<>', False)
]

# Black lines = unreconciled & (not linked to a payment or open balance created by statement
domain_matching = [('reconciled', '=', False)]
if partner_id:
domain_matching = expression.AND([
domain_matching,
[('account_id.internal_type', 'in', ['payable', 'receivable'])]
])
else:
# TODO : find out what use case this permits (match a check payment, registered on a journal whose account type is other instead of liquidity)
domain_matching = expression.AND([
domain_matching,
[('account_id.reconcile', '=', True)]
])
# default domain matching
domain_matching = expression.AND([
[('reconciled', '=', False)],
[('account_id.reconcile', '=', True)]
])

# Let's add what applies to both
domain = expression.OR([domain_reconciliation, domain_matching])
if partner_id:
domain = expression.AND([domain, [('partner_id', '=', partner_id)]])
Expand Down

0 comments on commit 645d9dc

Please sign in to comment.