Handle action url

This commit is contained in:
Cédric Krier committed 2008-05-08 13:17:04 +02:00
1 parent 13386f066c
commit 0a394c47ac
2 files changed
+13 -6

No files matched your search

+5
View File
@@ -8,6 +8,7 @@ import gettext
import tempfile
import base64
import os
import webbrowser
_ = gettext.gettext
@@ -148,6 +149,10 @@ class Action(object):
elif action['type'] == 'ir.action.report':
Action.exec_report(action['report_name'], datas)
elif action['type'] == 'ir.action.url':
if action['url']:
webbrowser.open(action['url'], new=2)
@staticmethod
def exec_keyword(keyword, data=None, context=None, warning=True,
alwaysask=False):
+8 -6
View File
@@ -128,12 +128,14 @@ class ViewForm(ParserView):
message(_('You must select a record ' \
'to use the relate button !'))
return False
act['domain'] = \
self.screen.current_model.expr_eval(
act['domain'], check_load=False)
act['context'] = str(
self.screen.current_model.expr_eval(
act['context'], check_load=False))
if 'domain' in act:
act['domain'] = \
self.screen.current_model.expr_eval(
act['domain'], check_load=False)
if 'context' in act:
act['context'] = str(
self.screen.current_model.expr_eval(
act['context'], check_load=False))
value = Action._exec_action(act, data, context)
if atype in ('print', 'action'):
self.screen.reload()