From 51f5471b83b7c8ff70a4e9a1c1026f72bb13f8cb Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 18 Jul 2012 16:12:54 +0200 Subject: [PATCH] [FIX] account: fixed untested code (that certainly never worked) when creating a cash register \!\!\! bzr revid: qdp-launchpad@openerp.com-20120718141254-vy7cinlhy39c4295 --- addons/account/account_cash_statement.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/account/account_cash_statement.py b/addons/account/account_cash_statement.py index bea48528f63..927ce94db31 100644 --- a/addons/account/account_cash_statement.py +++ b/addons/account/account_cash_statement.py @@ -132,18 +132,18 @@ class account_cash_statement(osv.osv): for obj in self.browse(cr, uid, ids, context=context): if obj.state == 'draft': - self.search(cr, uid, - [('journal_id', '=', journal_id),('state', '=', 'confirm')], + statement_ids = self.search(cr, uid, + [('journal_id', '=', obj.journal_id.id),('state', '=', 'confirm')], order='create_date desc', limit=1, context=context ) if not statement_ids: - return result - - st = self.browse(cr, uid, statement_ids[0], context=context) - result[obj.id] = st.balance_end_real + continue + else: + st = self.browse(cr, uid, statement_ids[0], context=context) + result[obj.id] = st.balance_end_real return result