From 55ef479cf0b40fbf6bb0aec9660af00df2104a24 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Thu, 25 Nov 2010 16:45:58 +0530 Subject: [PATCH 1/1] [FIX] Account: intiala balance with periods filter bzr revid: mra@mra-laptop-20101125111558-a3lj88wh6157e6yg --- addons/account/account_move_line.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 93d5c37..5b23330 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -82,7 +82,7 @@ class account_move_line(osv.osv): periods = fiscalperiod_obj.search(cr, uid, [('date_start', '<', first_period.date_start)]) periods = ','.join([str(x) for x in periods]) if periods: - query = obj+".state <> 'draft' AND "+obj+".period_id IN (SELECT id FROM account_period WHERE fiscalyear_id IN (%s) OR id IN (%s)) %s %s" % (fiscalyear_clause, periods, where_move_state, where_move_lines_by_date) + query = obj+".state <> 'draft' AND "+obj+".period_id IN (SELECT id FROM account_period WHERE fiscalyear_id IN (%s) AND id IN (%s)) %s %s" % (fiscalyear_clause, periods, where_move_state, where_move_lines_by_date) else: ids = ','.join([str(x) for x in context['periods']]) query = obj+".state <> 'draft' AND "+obj+".period_id IN (SELECT id FROM account_period WHERE fiscalyear_id IN (%s) AND id IN (%s)) %s %s" % (fiscalyear_clause, ids, where_move_state, where_move_lines_by_date) -- 1.7.10.4