summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorFlorian Gilbert <flg@odoo.com>2020-11-27 14:41:45 +0000
committerFlorian Gilbert <flg@odoo.com>2020-12-04 09:38:21 +0000
commit69fc9b71e991983b5bcddc948ac4c3749e305a3f (patch)
tree971270a582a161c6e128d75ed109ec5d412140ac /addons
parent1f0835a9d01b46b5cc617756f854c25541b644a7 (diff)
[FIX] account: check statement balance at each step
Previously, the check to see if a statement ending balance is the same as the computed balance was only done when moving from draft to posted which is wrong as people can modify the balance of posted statement programmatically which is the case when using online synchronization for example. Now perform that check at each change of state: draft->posted and posted->processed. Also the indication in the view to indicate that the balance was not the same was only displayed in draft, we removed that constraints as user should always see if there is a problem. closes odoo/odoo#62692 Related: odoo/enterprise#15070 Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/account/models/account_bank_statement.py1
-rw-r--r--addons/account/views/account_bank_statement_views.xml2
2 files changed, 2 insertions, 1 deletions
diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py
index 89c96dc53cb..02c810612f8 100644
--- a/addons/account/models/account_bank_statement.py
+++ b/addons/account/models/account_bank_statement.py
@@ -422,6 +422,7 @@ class AccountBankStatement(models.Model):
'res_id': statement.id
})
+ self._check_balance_end_real_same_as_computed()
self.write({'state': 'confirm', 'date_done': fields.Datetime.now()})
def button_validate_or_action(self):
diff --git a/addons/account/views/account_bank_statement_views.xml b/addons/account/views/account_bank_statement_views.xml
index 321ec61e743..d0d866657fc 100644
--- a/addons/account/views/account_bank_statement_views.xml
+++ b/addons/account/views/account_bank_statement_views.xml
@@ -78,7 +78,7 @@
<field name="name">account.bank.statement.tree</field>
<field name="model">account.bank.statement</field>
<field name="arch" type="xml">
- <tree decoration-danger="not is_difference_zero and state=='open'" decoration-info="state=='open' and is_difference_zero" string="Statements">
+ <tree decoration-danger="not is_difference_zero" decoration-info="state=='open' and is_difference_zero" string="Statements">
<field name="name"/>
<field name="date"/>
<field name="journal_id"/>