summaryrefslogtreecommitdiff
path: root/addons/account/tests/test_account_bank_statement.py
diff options
context:
space:
mode:
authorCedric Snauwaert <csn@openerp.com>2020-02-04 14:42:16 +0000
committerCedric Snauwaert <csn@openerp.com>2020-03-19 10:30:42 +0000
commiteee8ecdc0217ece1af28b850d1dcaaa528301682 (patch)
tree43f713fdb2c77564319594795155d55d2a9e6dab /addons/account/tests/test_account_bank_statement.py
parent3590efa47849be09e694e7755ec640f41cb14313 (diff)
[FIX] account: fix rounding error in is_valid_balance_start check
Field is_valid_balance_check is used to display a warning in case starting balance of a bank statement is not the same as ending balance of the previous statement. However the check was done without rounding resulting in some error in the following casse: starting_balance = 10.00000001 previous_ending_balance = 10 X-original-commit: 6673d23cfdee97b1e5e6368bc527a9a784578977
Diffstat (limited to 'addons/account/tests/test_account_bank_statement.py')
-rw-r--r--addons/account/tests/test_account_bank_statement.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/addons/account/tests/test_account_bank_statement.py b/addons/account/tests/test_account_bank_statement.py
index 6cd7b9820d7..3ac0030d2cc 100644
--- a/addons/account/tests/test_account_bank_statement.py
+++ b/addons/account/tests/test_account_bank_statement.py
@@ -191,6 +191,14 @@ class TestBankStatement(AccountTestCommon):
self.assertEqual(cash2.balance_start, 200)
self.assertEqual(cash2.balance_end_real, 1000)
+ def test_is_valid_balance_start(self):
+ bnk1 = self.create_bank_statement('2019-01-01', 100, 100.0000001)
+ bnk2 = self.create_bank_statement('2019-01-10', 50)
+ bnk2.write({'balance_start': 100})
+ self.assertTrue(bnk2.is_valid_balance_start)
+ bnk2.write({'balance_start': 100.01})
+ self.assertFalse(bnk2.is_valid_balance_start)
+
def test_unlink_bank_statement(self):
bnk1 = self.create_bank_statement('2019-01-02', 100)
bnk2 = self.create_bank_statement('2019-01-10', 50)