[FIX] account: reconciliation widget partner domain all reconcile accounts
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 odoo/odoo#31488 Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
This commit is contained in:
@@ -455,21 +455,12 @@ class AccountReconciliation(models.AbstractModel):
|
||||
('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)]])
|
||||
|
||||
Reference in New Issue
Block a user