From d3f5955317583a2e0d11a9d815e37949a9880806 Mon Sep 17 00:00:00 2001 From: "qdp-launchpad@tinyerp.com" <> Date: Tue, 16 Nov 2010 09:34:20 +0100 Subject: [PATCH] [FIX] account, account.move.line query_get: fixed the initial balance computation in order to check only the selected fiscalyear bzr revid: qdp-launchpad@tinyerp.com-20101116083420-rpr5nohjgsb851fk --- addons/account/account_move_line.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 94c4acf24aa..cdb692f454a 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -47,11 +47,8 @@ class account_move_line(osv.osv): if not context.get('fiscalyear', False): fiscalyear_ids = fiscalyear_obj.search(cr, uid, [('state', '=', 'draft')]) else: - if initial_bal: - fiscalyear_date_start = fiscalyear_obj.read(cr, uid, context['fiscalyear'], ['date_start'])['date_start'] - fiscalyear_ids = fiscalyear_obj.search(cr, uid, [('date_stop', '<', fiscalyear_date_start), ('state', '=', 'draft')], context=context) - else: - fiscalyear_ids = [context['fiscalyear']] + #for initial balance as well as for normal query, we check only the selected FY because the best practice is to generate the FY opening entries + fiscalyear_ids = [context['fiscalyear']] fiscalyear_clause = (','.join([str(x) for x in fiscalyear_ids])) or '0' state = context.get('state', False) @@ -1264,4 +1261,4 @@ class account_move_line(osv.osv): account_move_line() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: