account report: fix read_group() API mismatch

read_group() of account entries and followup reports didn't match that of
server. We'd better use generic references to positional and keyword
arguments instead.

bzr revid: p_christ@hol.gr-20101214153608-mbcjfzu26wolyip9
This commit is contained in:
P. Christeas
2010-12-14 17:36:08 +02:00
parent 56d65e54fe
commit 7583a7da04
2 changed files with 4 additions and 4 deletions
@@ -94,7 +94,7 @@ class account_entries_report(osv.osv):
return super(account_entries_report, self).search(cr, uid, args=args, offset=offset, limit=limit, order=order,
context=context, count=count)
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None):
def read_group(self, cr, uid, domain, *args, **kwargs):
todel=[]
fiscalyear_obj = self.pool.get('account.fiscalyear')
period_obj = self.pool.get('account.period')
@@ -112,7 +112,7 @@ class account_entries_report(osv.osv):
for a in [['period_id','in','current_year'], ['period_id','in','current_period']]:
if a in domain:
domain.remove(a)
return super(account_entries_report, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context)
return super(account_entries_report, self).read_group(cr, uid, domain, *args, **kwargs)
def init(self, cr):
tools.drop_view_if_exists(cr, 'account_entries_report')
@@ -55,14 +55,14 @@ class account_followup_stat(osv.osv):
return super(account_followup_stat, self).search(cr, uid, args=args, offset=offset, limit=limit, order=order,
context=context, count=count)
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None):
def read_group(self, cr, uid, domain, *args, **kwargs):
for arg in domain:
if arg[0] == 'period_id' and arg[2] == 'current_year':
current_year = self.pool.get('account.fiscalyear').find(cr, uid)
ids = self.pool.get('account.fiscalyear').read(cr, uid, [current_year], ['period_ids'])[0]['period_ids']
domain.append(['period_id','in',ids])
domain.remove(arg)
return super(account_followup_stat, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context)
return super(account_followup_stat, self).read_group(cr, uid, domain, *args, **kwargs)
def init(self, cr):
tools.drop_view_if_exists(cr, 'account_followup_stat')