[IMP] don't be a poopyhead, learn how to use dicts
bzr revid: xmo@openerp.com-20110727150942-oekqzfckrm29ixu6
This commit is contained in:
parent
59d1f3dc4e
commit
52f4c70132
|
@ -300,22 +300,21 @@ def load_actions_from_ir_values(req, key, key2, models, meta, context):
|
|||
for id, name, action in actions]
|
||||
|
||||
def clean_action(action, session):
|
||||
action.setdefault('flags', {})
|
||||
if action['type'] != 'ir.actions.act_window':
|
||||
return action
|
||||
# values come from the server, we can just eval them
|
||||
if isinstance(action.get('context', None), basestring):
|
||||
if isinstance(action.get('context'), basestring):
|
||||
action['context'] = eval(
|
||||
action['context'],
|
||||
session.evaluation_context()) or {}
|
||||
|
||||
if isinstance(action.get('domain', None), basestring):
|
||||
if isinstance(action.get('domain'), basestring):
|
||||
action['domain'] = eval(
|
||||
action['domain'],
|
||||
session.evaluation_context(
|
||||
action.get('context', {}))) or []
|
||||
if 'flags' not in action:
|
||||
# Set empty flags dictionary for web client.
|
||||
action['flags'] = dict()
|
||||
|
||||
return fix_view_modes(action)
|
||||
|
||||
def generate_views(action):
|
||||
|
|
Loading…
Reference in New Issue