[IMP] account: account.move.line => query_get method updated for charts of accounts

bzr revid: mra@mra-laptop-20100712132630-o0ehzcj2epag5a65
This commit is contained in:
Mustufa Rangwala 2010-07-12 18:56:30 +05:30
parent fa45f92f09
commit cf8d254a72
1 changed files with 12 additions and 7 deletions

View File

@ -20,6 +20,7 @@
##############################################################################
import time
from datetime import datetime
from operator import itemgetter
import netsvc
from osv import fields, osv
@ -65,6 +66,10 @@ class account_move_line(osv.osv):
if context.get('journal_ids', False):
query += ' AND '+obj+'.journal_id in (%s)' % ','.join(map(str, context['journal_ids']))
if context.get('chart_account_id', False):
child_ids = self.pool.get('account.account')._get_children_and_consol(cr, uid, [context['chart_account_id']], context=context)
query += ' AND '+obj+'.account_id in (%s)' % ','.join(map(str, child_ids))
if context.get('period_manner','') == 'created':
#the query have to be build with no reference to periods but thanks to the creation date
if context.get('periods',False):