[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
This commit is contained in:
qdp-launchpad@tinyerp.com 2010-11-16 09:34:20 +01:00
parent 9ce4c19ddb
commit d3f5955317
1 changed files with 3 additions and 6 deletions

View File

@ -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:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: