diff options
| author | Christophe Simonis <chs@odoo.com> | 2014-10-01 19:18:14 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2014-10-01 19:18:14 +0200 |
| commit | 709c9868de7c4ac4985ed4e0055ae3e3e49742ad (patch) | |
| tree | e90227a947bddf47b3043fcbe8b99529a22aa7dd /addons/web/static/src/js/view_form.js | |
| parent | 85f26244a71a0b9a7faa283d6d24fdde6bae899a (diff) | |
| parent | e8831932464814ed5f9e3a0af33f98891a466417 (diff) | |
[MERGE] forward port of branch 8.0 up to e883193
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())); |
