diff --git a/tryton/common/common.py b/tryton/common/common.py index 3a14933992..f66549c35a 100644 --- a/tryton/common/common.py +++ b/tryton/common/common.py @@ -132,6 +132,16 @@ def file_selection(title, filename='', parent=None, return filenames def file_open(filename, type, parent, print_p=False): + if os.name == 'nt': + operation = 'open' + if print_p: + operation = 'print' + try: + os.startfile(os.path.normpath(filename), operation) + except: + # Try without operation, it is not supported on version < 2.5 + os.startfile(os.path.normpath(filename)) + return cmd = '' if type in CONFIG['client.actions']: if print_p: diff --git a/tryton/gui/main.py b/tryton/gui/main.py index 61cc1c2a63..9222bd89d1 100644 --- a/tryton/gui/main.py +++ b/tryton/gui/main.py @@ -599,6 +599,10 @@ class Main(object): self.glade.get_widget(signals[signal][2]).set_active( int(bool(CONFIG[signals[signal][1]]))) + if os.name == 'nt': + # Disable actions, on win32 we use os.startfile + self.glade.get_widget('actions').set_sensitive(False) + # Adding a timer the check to requests gobject.timeout_add(5 * 60 * 1000, self.request_set) _MAIN.append(self)