[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:
parent
9ce4c19ddb
commit
d3f5955317
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue