diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 11e474bf16f..7bb6f3e5761 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -308,7 +308,7 @@ class account_bank_statement(osv.osv): def balance_check(self, cr, uid, st_id, journal_type='bank', context=None): st = self.browse(cr, uid, st_id, context=context) - if not (abs((st.balance_end or 0.0) - st.balance_end_real) < 0.0001): + if not ((abs((st.balance_end or 0.0) - st.balance_end_real) < 0.0001) or (abs((st.balance_end or 0.0) - st.balance_end_cash) < 0.0001)): raise osv.except_osv(_('Error !'), _('The statement balance is incorrect !\nThe expected balance (%.2f) is different than the computed one. (%.2f)') % (st.balance_end_real, st.balance_end)) return True @@ -358,7 +358,10 @@ class account_bank_statement(osv.osv): st_line_number = self.get_next_st_line_number(cr, uid, st_number, st_line, context) self.create_move_from_st_line(cr, uid, st_line.id, company_currency_id, st_line_number, context) - self.write(cr, uid, [st.id], {'name': st_number}, context=context) + self.write(cr, uid, [st.id], { + 'name': st_number, + 'balance_end_real': st.balance_end + }, context=context) self.log(cr, uid, st.id, _('Statement %s is confirmed, journal items are created.') % (st_number,)) return self.write(cr, uid, ids, {'state':'confirm'}, context=context) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 9ae59f62456..25faae589d5 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -477,7 +477,7 @@ - + diff --git a/addons/account/project/report/analytic_balance.rml b/addons/account/project/report/analytic_balance.rml index 77182b5bb9f..0c488eac400 100644 --- a/addons/account/project/report/analytic_balance.rml +++ b/addons/account/project/report/analytic_balance.rml @@ -1,6 +1,6 @@ -