diff options
Diffstat (limited to 'addons/web/static/src/js/view_form.js')
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 13 |
1 files changed, 9 insertions, 4 deletions
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())); |
