[FIX] account: fixed the query_get of account.move.line

bzr revid: qdp-launchpad@tinyerp.com-20110110114400-dnbowby75l9rlr7k
This commit is contained in:
qdp-launchpad@tinyerp.com 2011-01-10 12:44:00 +01:00
parent 186713ef9d
commit 45fcc2b1ba
1 changed files with 1 additions and 1 deletions

View File

@ -78,7 +78,7 @@ class account_move_line(osv.osv):
context['periods'] = fiscalperiod_obj.build_ctx_periods(cr, uid, context['period_from'], context['period_to'])
if context.get('periods', False):
if initial_bal:
query = obj+".state <> 'draft' AND "+obj+".period_id IN (SELECT id FROM account_period WHERE fiscalyear_id IN (%s) %s %s)" % (fiscalyear_clause, 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)) %s %s" % (fiscalyear_clause, where_move_state, where_move_lines_by_date)
period_ids = fiscalperiod_obj.search(cr, uid, [('id', 'in', context['periods'])], order='date_start', limit=1)
if period_ids and period_ids[0]:
first_period = fiscalperiod_obj.browse(cr, uid, period_ids[0], context=context)