diff options
| author | Laurent Smet <las@odoo.com> | 2021-01-28 12:18:52 +0000 |
|---|---|---|
| committer | Laurent Smet <las@odoo.com> | 2021-01-28 12:26:22 +0000 |
| commit | 73ddcfbcc58b7a6542ced4bd8b20dd67c9f446ee (patch) | |
| tree | 662f0f83394045c65804cfaa1654730b7d449a16 /addons/account/tests | |
| parent | d5e503f02f94ea4125010f09b1877040c8fc68b3 (diff) | |
[FIX] account: Fix 'is_reconciled' flag for zero-amount statement line
When the suspense account is not reconcilable, 'suspense_lines.reconciled' always gives 'False' leading to a not reconciled statement line.
closes odoo/odoo#65211
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Diffstat (limited to 'addons/account/tests')
| -rw-r--r-- | addons/account/tests/test_account_bank_statement.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/addons/account/tests/test_account_bank_statement.py b/addons/account/tests/test_account_bank_statement.py index c582a6d1dc3..8d3ba4983e0 100644 --- a/addons/account/tests/test_account_bank_statement.py +++ b/addons/account/tests/test_account_bank_statement.py @@ -1549,3 +1549,23 @@ class TestAccountBankStatementLine(TestAccountBankStatementCommon): {'amount_currency': 226.04, 'debit': 193.22, 'credit': 0.0}, {'amount_currency': -7767.70, 'debit': 0.0, 'credit': 6640.19}, ]) + + def test_zero_amount_statement_line(self): + ''' Ensure the statement line is directly marked as reconciled when having an amount of zero. ''' + self.company_data['company'].account_journal_suspense_account_id.reconcile = False + + statement = self.env['account.bank.statement'].with_context(skip_check_amounts_currencies=True).create({ + 'name': 'test_statement', + 'date': '2017-01-01', + 'journal_id': self.bank_journal_2.id, + 'line_ids': [ + (0, 0, { + 'date': '2019-01-01', + 'payment_ref': "Happy new year", + 'amount': 0.0, + }), + ], + }) + statement_line = statement.line_ids + + self.assertRecordValues(statement_line, [{'is_reconciled': True, 'amount_residual': 0.0}]) |
