[FIX] account: bank reconciliation was auto-reconciling undistincly debit lines on bank accounts with negative amounts and/or credit lines with positive amounts where only one field (debit/credit) should be checked if the amount is positive/negative.
This commit is contained in:
@@ -576,10 +576,11 @@ class AccountBankStatementLine(models.Model):
|
||||
domain = [(f, '>', 0), (f, '<', amount)]
|
||||
elif comparator == '=':
|
||||
if f == 'amount_residual':
|
||||
liquidity_field = amount > 0 and 'debit' or 'credit'
|
||||
domain = [
|
||||
'|', (f, '=', float_round(amount, precision_digits=p)),
|
||||
'&', ('account_id.internal_type', '=', 'liquidity'),
|
||||
'|', ('debit', '=', amount), ('credit', '=', amount),
|
||||
(liquidity_field, '=', amount),
|
||||
]
|
||||
else:
|
||||
domain = [
|
||||
|
||||
Reference in New Issue
Block a user