diff options
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/search.js | 5 | ||||
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 13 | ||||
| -rw-r--r-- | addons/web/static/src/js/view_list.js | 5 |
3 files changed, 13 insertions, 10 deletions
diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 17458e1c185..f14b8c010f1 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -1636,8 +1636,7 @@ instance.web.search.ManyToOneField = instance.web.search.CharField.extend({ 'contexts', [this.view.dataset.get_context()]); return this.model.call('name_search', [], { name: needle, - args: instance.web.pyeval.eval( - 'domains', this.attrs.domain ? [this.attrs.domain] : [], context), + args: (typeof this.attrs.domain === 'string') ? [] : this.attrs.domain, limit: 8, context: context }).then(function (results) { @@ -2367,7 +2366,7 @@ instance.web.search.AutoComplete = instance.web.Widget.extend({ switch (ev.which) { case $.ui.keyCode.TAB: case $.ui.keyCode.ENTER: - if (self.get_search_string().length) { + if (self.current_result && self.get_search_string().length) { self.select_item(ev); } break; diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index a48b029f728..aca6f2c1c12 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2864,7 +2864,7 @@ instance.web.form.FieldTextHtml = instance.web.form.AbstractField.extend(instanc if (! this.get("effective_readonly")) { self._updating_editor = false; this.$textarea = this.$el.find('textarea'); - var width = ((this.node.attrs || {}).editor_width || 'auto'); + var width = ((this.node.attrs || {}).editor_width || 'calc(100% - 4px)'); var height = ((this.node.attrs || {}).editor_height || 250); this.$textarea.cleditor({ width: width, // width not including margins, borders or padding @@ -3419,9 +3419,14 @@ instance.web.form.M2ODialog = instance.web.Dialog.extend({ this.$("p").text( text ); this.$buttons.html(QWeb.render("M2ODialog.buttons")); this.$("input").val(this.getParent().last_query); - this.$buttons.find(".oe_form_m2o_qc_button").click(function(){ - self.getParent()._quick_create(self.$("input").val()); - self.destroy(); + this.$buttons.find(".oe_form_m2o_qc_button").click(function(e){ + if (self.$("input").val() != ''){ + self.getParent()._quick_create(self.$("input").val()); + self.destroy(); + } else{ + e.preventDefault(); + self.$("input").focus(); + } }); this.$buttons.find(".oe_form_m2o_sc_button").click(function(){ self.getParent()._search_create_popup("form", undefined, self.getParent()._create_context(self.$("input").val())); diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 9df9247f485..d7e867ad665 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -374,9 +374,8 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi var $column = $(e.currentTarget); var col_name = $column.data('id'); var field = this.fields_view.fields[col_name]; - // test if the field is a function field with store=false, since it's impossible - // for the server to sort those fields we desactivate the feature - if (field && field.store === false) { + // test whether the field is sortable + if (field && !field.sortable) { return false; } this.dataset.sort(col_name); |
