password, db = operator.itemgetter(
'drop_pwd', 'drop_db')(
dict(map(operator.itemgetter('name', 'value'), fields)))
-
+
try:
if request.session.proxy("db").drop(password, db):
return True
class Action(http.Controller):
@http.route('/web/action/load', type='json', auth="user")
- def load(self, action_id, do_not_eval=False):
+ def load(self, action_id, do_not_eval=False, additional_context=None):
Actions = request.session.model('ir.actions.actions')
value = False
try:
base_action = Actions.read([action_id], ['type'], request.context)
if base_action:
- ctx = {}
+ ctx = request.context
action_type = base_action[0]['type']
if action_type == 'ir.actions.report.xml':
ctx.update({'bin_size': True})
- ctx.update(request.context)
+ if additional_context:
+ ctx.update(additional_context)
action = request.session.model(action_type).read([action_id], False, ctx)
if action:
value = clean_action(action[0])
sakey = Session().save_session_action(action)
debug = '?debug' if req.debug else ''
return werkzeug.utils.redirect('/web{0}#sa={1}'.format(debug, sakey))
-
+
# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4: