diff --git a/sao/src/view/form.js b/sao/src/view/form.js index c57c6a3d9e..b5da480e28 100644 --- a/sao/src/view/form.js +++ b/sao/src/view/form.js @@ -4080,11 +4080,15 @@ function eval_pyson(value){ key_press: function(evt) { var editable = !this.text.prop('readonly'); if (evt.which == Sao.common.F3_KEYCODE && editable) { - this.new_(); evt.preventDefault(); + this.select(); } else if (evt.which == Sao.common.F2_KEYCODE) { - this.open(); evt.preventDefault(); + if (this.filename) { + this.open(); + } else { + this.save_as(); + } } }, set_value: function() { diff --git a/tryton/tryton/gui/window/view_form/view/form_gtk/binary.py b/tryton/tryton/gui/window/view_form/view/form_gtk/binary.py index f1a73b6552..8f55a18f88 100644 --- a/tryton/tryton/gui/window/view_form/view/form_gtk/binary.py +++ b/tryton/tryton/gui/window/view_form/view/form_gtk/binary.py @@ -182,13 +182,13 @@ class Binary(BinaryMixin, Widget): def sig_key_press(self, widget, event, *args): editable = self.wid_text and self.wid_text.get_editable() if event.keyval == Gdk.KEY_F3 and editable: - self.sig_new(widget) + self.select(widget) return True elif event.keyval == Gdk.KEY_F2: if self.filename: - self.sig_open(widget) + self.open_() else: - self.sig_save_as(widget) + self.save_as() return True return False