From 90f998da0bb15b77232b145f1749b46e176f6552 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 1 Apr 2015 10:52:37 +0200 Subject: [PATCH] [FIX] *: alias help message When going to logged calls through opportunities, and no logged calls were listed, the mail alias of opportunities was displayed within the placeholder help message, wrongly, as we were in the logged calls list. This was due to a context propagation, due to have defined empty_list_help_* keys within window actions. It was the case in several modules. Besides, we do not find the usefulness of the custom_context passed to the get_empty_list_help method: indeed, none of the methods get_empty_list_help overriden in modules need any other keys than 'default_type', which do not require an evaluated context. We therefore remove the whole code regarding this custom_context, and we therefore get rid of this useless context evaluation thing within one of the most accessed method of the web client. opw-630673 --- addons/crm/crm_lead_menu.xml | 1 - addons/hr_recruitment/hr_recruitment_menu.xml | 2 +- addons/hr_recruitment/hr_recruitment_view.xml | 2 +- openerp/addons/base/ir/ir_actions.py | 16 ++-------------- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/addons/crm/crm_lead_menu.xml b/addons/crm/crm_lead_menu.xml index 2569b85972d..a38eb79411c 100644 --- a/addons/crm/crm_lead_menu.xml +++ b/addons/crm/crm_lead_menu.xml @@ -12,7 +12,6 @@ { 'default_type':'lead', 'stage_type':'lead', - 'empty_list_help_model': 'crm.case.section', 'needaction_menu_ref': 'crm.menu_crm_opportunities', 'search_default_unassigned':1, } diff --git a/addons/hr_recruitment/hr_recruitment_menu.xml b/addons/hr_recruitment/hr_recruitment_menu.xml index 4c0dd875e1f..241fee98286 100644 --- a/addons/hr_recruitment/hr_recruitment_menu.xml +++ b/addons/hr_recruitment/hr_recruitment_menu.xml @@ -8,7 +8,7 @@ kanban,tree,form,graph,calendar - {'empty_list_help_model': 'hr.job'} + {}

Odoo helps you track applicants in the recruitment diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml index 878fe70b18d..f02e65a6e16 100644 --- a/addons/hr_recruitment/hr_recruitment_view.xml +++ b/addons/hr_recruitment/hr_recruitment_view.xml @@ -311,7 +311,7 @@ Applications hr.applicant kanban,tree,form,graph,calendar - {'search_default_job_id': [active_id], 'default_job_id': active_id, 'empty_list_help_model': 'hr.job'} + {'search_default_job_id': [active_id], 'default_job_id': active_id}

Odoo helps you track applicants in the recruitment diff --git a/openerp/addons/base/ir/ir_actions.py b/openerp/addons/base/ir/ir_actions.py index 7dcdb5ce279..abdd33cbaa9 100644 --- a/openerp/addons/base/ir/ir_actions.py +++ b/openerp/addons/base/ir/ir_actions.py @@ -325,23 +325,11 @@ class ir_actions_act_window(osv.osv): results = super(ir_actions_act_window, self).read(cr, uid, ids, fields=fields, context=context, load=load) if not fields or 'help' in fields: - context = dict(context or {}) - eval_dict = { - 'active_model': context.get('active_model'), - 'active_id': context.get('active_id'), - 'active_ids': context.get('active_ids'), - 'uid': uid, - } for res in results: model = res.get('res_model') if model and self.pool.get(model): - try: - with tools.mute_logger("openerp.tools.safe_eval"): - eval_context = eval(res['context'] or "{}", eval_dict) or {} - except Exception: - continue - custom_context = dict(context, **eval_context) - res['help'] = self.pool[model].get_empty_list_help(cr, uid, res.get('help', ""), context=custom_context) + ctx = dict(context or {}) + res['help'] = self.pool[model].get_empty_list_help(cr, uid, res.get('help', ""), context=ctx) if ids_int: return results[0] return results