[FIX] account_analytic_analysis : Analytic account functional field methods corrected.
lp bug: https://launchpad.net/bugs/396637 fixed bzr revid: jvo@tinyerp.com-20091022134316-sa5mrf2u0qei3wpg
This commit is contained in:
parent
1bbc432293
commit
0c935cec34
|
@ -371,10 +371,13 @@ class account_analytic_account(osv.osv):
|
|||
res = {}
|
||||
for id in ids:
|
||||
ids2 = self.search(cr, uid, [('parent_id', 'child_of', [id])])
|
||||
cr.execute('SELECT DISTINCT(month_id) FROM account_analytic_analysis_summary_month ' \
|
||||
'WHERE account_id in (' + ','.join([str(x) for x in ids2]) + ') ' \
|
||||
'AND unit_amount <> 0.0')
|
||||
res[id] = [int(id * 1000000 + int(x[0])) for x in cr.fetchall()]
|
||||
if ids2:
|
||||
cr.execute('SELECT DISTINCT(month_id) FROM account_analytic_analysis_summary_month ' \
|
||||
'WHERE account_id in (' + ','.join([str(x) for x in ids2]) + ') ' \
|
||||
'AND unit_amount <> 0.0')
|
||||
res[id] = [int(id * 1000000 + int(x[0])) for x in cr.fetchall()]
|
||||
else:
|
||||
res[id] = []
|
||||
return res
|
||||
|
||||
def _user(self, cr, uid, ids, name, arg, context=None):
|
||||
|
@ -383,10 +386,13 @@ class account_analytic_account(osv.osv):
|
|||
max_user = cr.fetchone()[0]
|
||||
for id in ids:
|
||||
ids2 = self.search(cr, uid, [('parent_id', 'child_of', [id])])
|
||||
cr.execute('SELECT DISTINCT("user") FROM account_analytic_analysis_summary_user ' \
|
||||
'WHERE account_id in (' + ','.join([str(x) for x in ids2]) + ') ' \
|
||||
'AND unit_amount <> 0.0')
|
||||
res[id] = [int((id * max_user) + x[0]) for x in cr.fetchall()]
|
||||
if ids2:
|
||||
cr.execute('SELECT DISTINCT("user") FROM account_analytic_analysis_summary_user ' \
|
||||
'WHERE account_id in (' + ','.join([str(x) for x in ids2]) + ') ' \
|
||||
'AND unit_amount <> 0.0')
|
||||
res[id] = [int((id * max_user) + x[0]) for x in cr.fetchall()]
|
||||
else:
|
||||
res[id] = []
|
||||
return res
|
||||
|
||||
_columns ={
|
||||
|
|
Loading…
Reference in New Issue