[REVERT] Analytic: changes reverted for rev 4927 (act window on analytic form)

bzr revid: mra@mra-laptop-20110201125345-t9jxwatp239l0w5w
This commit is contained in:
Mustufa Rangwala 2011-02-01 18:23:45 +05:30
parent 19cf9e1054
commit cda4bc7204
2 changed files with 4 additions and 7 deletions

View File

@ -136,7 +136,7 @@
<field name="help">The normal chart of accounts has a structure defined by the legal requirement of the country. The analytic chart of account structure should reflect your own business needs in term of costs/revenues reporting. They are usually structured by contracts, projects, products or departements. Most of the OpenERP operations (invoices, timesheets, expenses, etc) generate analytic entries on the related account.</field>
</record>
<menuitem groups="analytic.group_analytic_accounting" id="next_id_40"
<menuitem groups="analytic.group_analytic_accounting" id="next_id_40"
name="Analytic" parent="account.menu_finance_generic_reporting"
sequence="4"/>
@ -373,7 +373,7 @@
<field name="help">To print an analytics (or costs) journal for a given period. The report give code, move name, account number, general amount and analytic amount.</field>
</record>
<menuitem groups="analytic.group_analytic_accounting"
action="action_account_analytic_journal_tree"
action="action_account_analytic_journal_tree"
id="account_analytic_journal_print" parent="account.next_id_40"/>
#
@ -445,7 +445,7 @@
</record>
<act_window
context="{'search_default_account_id': [active_id], 'search_default_user_id': False, 'analytic_act_window': True}"
context="{'search_default_account_id': [active_id], 'search_default_user_id': False}"
id="act_acc_analytic_acc_5_report_hr_timesheet_invoice_journal"
name="All Analytic Entries"
res_model="account.analytic.line"

View File

@ -226,10 +226,7 @@ class account_analytic_account(osv.osv):
return self.name_get(cr, uid, project_ids, context=context)
account = self.search(cr, uid, [('code', '=', name)] + args, limit=limit, context=context)
if not account:
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)
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)