[FIX] Performed boolean check for context and domain and removed redundant condition: (Maintenance Case : 574769)

bzr revid: rgo@tinyerp.com-20120521095011-4ji9wf6efbhr4yry
This commit is contained in:
Ravi Gohil (Open ERP) 2012-05-21 15:20:11 +05:30
commit 47815f1c0a
1 changed files with 3 additions and 3 deletions

View File

@ -683,10 +683,10 @@ def clean_action(req, action, do_not_eval=False):
if not do_not_eval: if not do_not_eval:
# values come from the server, we can just eval them # values come from the server, we can just eval them
if isinstance(action.get('context'), basestring): if action.get('context') and isinstance(action.get('context'), basestring):
action['context'] = eval( action['context'], eval_ctx ) or {} action['context'] = eval( action['context'], eval_ctx ) or {}
if isinstance(action.get('domain'), basestring): if action.get('domain') and isinstance(action.get('domain'), basestring):
action['domain'] = eval( action['domain'], eval_ctx ) or [] action['domain'] = eval( action['domain'], eval_ctx ) or []
else: else:
if 'context' in action: if 'context' in action:
@ -719,7 +719,7 @@ def generate_views(action):
:param dict action: action descriptor dictionary to generate a views key for :param dict action: action descriptor dictionary to generate a views key for
""" """
view_id = action.get('view_id', False) view_id = action.get('view_id') or False
if isinstance(view_id, (list, tuple)): if isinstance(view_id, (list, tuple)):
view_id = view_id[0] view_id = view_id[0]