[FIX] Account: Can not display list of analytic entries when you open it's list view from Analytic Account form
lp bug: https://launchpad.net/bugs/708593 fixed bzr revid: mra@mra-laptop-20110131112954-bu52z59kadnitzkt
This commit is contained in:
commit
95f1374a00
|
@ -445,7 +445,7 @@
|
|||
</record>
|
||||
|
||||
<act_window
|
||||
context="{'search_default_account_id': [active_id], 'search_default_user_id': False}"
|
||||
context="{'search_default_account_id': [active_id], 'search_default_user_id': False, 'analytic_act_window': True}"
|
||||
id="act_acc_analytic_acc_5_report_hr_timesheet_invoice_journal"
|
||||
name="All Analytic Entries"
|
||||
res_model="account.analytic.line"
|
||||
|
|
|
@ -109,12 +109,12 @@ class account_analytic_account(osv.osv):
|
|||
def _complete_name_calc(self, cr, uid, ids, prop, unknow_none, unknow_dict):
|
||||
res = self.name_get(cr, uid, ids)
|
||||
return dict(res)
|
||||
|
||||
|
||||
def _child_compute(self, cr, uid, ids, name, arg, context=None):
|
||||
result = {}
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
|
||||
for account in self.browse(cr, uid, ids, context=context):
|
||||
for child in account.child_ids:
|
||||
if child.state == 'template':
|
||||
|
@ -227,13 +227,16 @@ class account_analytic_account(osv.osv):
|
|||
cr.execute("select analytic_account_id from project_project")
|
||||
project_ids = [x[0] for x in cr.fetchall()]
|
||||
return self.name_get(cr, uid, project_ids, context=context)
|
||||
account = self.search(cr, uid, [('code', '=', name)]+args, limit=limit, context=context)
|
||||
account = self.search(cr, uid, [('code', '=', name)] + args, limit=limit, context=context)
|
||||
if not account:
|
||||
account = self.search(cr, uid, [('name', 'ilike', '%%%s%%' % name)]+args, limit=limit, context=context)
|
||||
if context.get('analytic_act_window', False) and context.get('active_id', False):
|
||||
account = self.search(cr, uid, [('id', '=', context['active_id'])] + args, limit=limit, context=context)
|
||||
else:
|
||||
account = self.search(cr, uid, [('name', 'ilike', '%%%s%%' % name)] + args, limit=limit, context=context)
|
||||
newacc = account
|
||||
while newacc:
|
||||
newacc = self.search(cr, uid, [('parent_id', 'in', newacc)]+args, limit=limit, context=context)
|
||||
account+=newacc
|
||||
account += newacc
|
||||
return self.name_get(cr, uid, account, context=context)
|
||||
|
||||
account_analytic_account()
|
||||
|
|
Loading…
Reference in New Issue