[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#62879 X-original-commit: 69fc9b71e991983b5bcddc948ac4c3749e305a3f Related: odoo/enterprise#15155 Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com> Signed-off-by: Florian Gilbert <FlorianGilbert@users.noreply.github.com>
This commit is contained in:
@@ -426,6 +426,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):
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
Reference in New Issue
Block a user