diff options
| author | Gery Debongnie <ged@openerp.com> | 2014-04-30 16:04:23 +0200 |
|---|---|---|
| committer | Gery Debongnie <ged@openerp.com> | 2014-04-30 16:04:23 +0200 |
| commit | a6b25061ba461c12b22a8945e43134a0bc79d5ee (patch) | |
| tree | 60b5e702f1f31324e36d2d51b7b1b777994b2cb4 /addons/web/static/src | |
| parent | 1f693aaed6f6e28a384f20d357f8a3f558d33f6a (diff) | |
| parent | 7dedde91eff41752724efcbbefa5e0ca7e1ae3e0 (diff) | |
[MERGE] merge from trunk
bzr revid: ged@openerp.com-20140430085942-umusyhp4cs2ffezj
bzr revid: ged@openerp.com-20140430140423-kq0vdboq1mux4zfn
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/core.js | 13 | ||||
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 7 | ||||
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 7 |
3 files changed, 15 insertions, 12 deletions
diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index a4bcd1922de..74866112d99 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -460,14 +460,11 @@ instance.web.Session.include( /** @lends instance.web.Session# */{ .appendTo(document.body) .load(function () { try { - if (options.error) { - if (!this.contentDocument.body.childNodes[1]) { - options.error(this.contentDocument.body.childNodes); - } - else { - options.error(JSON.parse(this.contentDocument.body.childNodes[1].textContent)); - } - } + if (options.error) { + var body = this.contentDocument.body; + var node = body.childNodes[1] || body.childNodes[0]; + options.error(JSON.parse(node.textContent)); + } } finally { complete(); } diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 247fd2d2a1a..e14d60747ed 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3356,13 +3356,16 @@ instance.web.form.CompletionFieldMixin = { instance.web.form.M2ODialog = instance.web.Dialog.extend({ template: "M2ODialog", init: function(parent) { + this.name = parent.string; this._super(parent, { - title: _.str.sprintf(_t("Add %s"), parent.string), + title: _.str.sprintf(_t("Create a %s"), parent.string), size: 'medium', }); }, start: function() { var self = this; + var text = _.str.sprintf(_t("You are creating a new %s, are you sure it does not exist yet?"), self.name); + 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(){ @@ -3621,6 +3624,8 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc minLength: 0, delay: 250 }); + // set position for list of suggestions box + this.$input.autocomplete( "option", "position", { my : "left top", at: "left bottom" } ); this.$input.autocomplete("widget").openerpClass(); // used to correct a bug when selecting an element by pushing 'enter' in an editable list this.$input.keyup(function(e) { diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 24c5ba625b0..49c40579f27 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1948,13 +1948,14 @@ </t> <t t-name="M2ODialog"> <div> + <p class="oe_grey"/> Name: <input class="oe_form_m2o_input_name" type="text"/> </div> </t> <t t-name="M2ODialog.buttons"> - <button class="oe_form_m2o_qc_button oe_button oe_highlight">Quick Add</button> - <button class="oe_form_m2o_sc_button oe_button">Add All Info...</button> - <button class="oe_form_m2o_cancel_button oe_button">Cancel</button> + <button class="oe_form_m2o_qc_button oe_button oe_highlight">Create</button> + <button class="oe_form_m2o_sc_button oe_button">Create and edit</button> or + <button class="oe_form_m2o_cancel_button oe_button oe_link"><span>Cancel</span></button> </t> <t t-name="FieldMonetary" t-extend="FieldChar"> <t t-jquery="t:first" t-operation="before"> |
