diff --git a/tryton/common/common.py b/tryton/common/common.py index 9e1e62ef34..0a4ed4cd98 100644 --- a/tryton/common/common.py +++ b/tryton/common/common.py @@ -242,6 +242,16 @@ def file_open(filename, type, parent, print_p=False): # Try without operation, it is not supported on version < 2.5 os.startfile(os.path.normpath(filename)) return + elif os.name == 'mac': + pid = os.fork() + if not pid: + pid = os.fork() + if not pid: + os.execv('/usr/bin/open', ['/usr/bin/open', filename]) + time.sleep(0.1) + sys.exit(0) + os.waitpid(pid, 0) + return cmd = '' if type in CONFIG['client.actions']: if print_p: diff --git a/tryton/gui/main.py b/tryton/gui/main.py index 4ae0a87758..7614b6c241 100644 --- a/tryton/gui/main.py +++ b/tryton/gui/main.py @@ -191,8 +191,9 @@ class Main(object): self.glade.get_widget(signals[signal][2]).set_active( int(bool(CONFIG[signals[signal][1]]))) - if os.name == 'nt': + if os.name in ('nt', 'mac'): # Disable actions, on win32 we use os.startfile + # and on mac we use /usr/bin/open self.glade.get_widget('actions').set_sensitive(False) # Adding a timer the check to requests