diff options
| author | Gery Debongnie <ged@openerp.com> | 2014-02-25 10:13:10 +0100 |
|---|---|---|
| committer | Gery Debongnie <ged@openerp.com> | 2014-02-25 10:13:10 +0100 |
| commit | 893b7041f97a5f98dbb95affdfeecbcdb6db69ed (patch) | |
| tree | 463444a7e755b66a6fb3f7aefc5c5f2b6a6bf074 /addons/web/static/src/js/view_form.js | |
| parent | 2ab61cf001fab1d30050598931bfa39956cf4883 (diff) | |
| parent | eaa20f9586f5d9a7a52ed5a7cc565d620e0ad44a (diff) | |
[MERGE] merge from trunk
bzr revid: ged@openerp.com-20140225091310-pzkj5ip17esl52kz
Diffstat (limited to 'addons/web/static/src/js/view_form.js')
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 4576e9d328d..f1fc377fa94 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1030,8 +1030,9 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM open_defaults_dialog: function () { var self = this; var display = function (field, value) { + if (!value) { return value; } if (field instanceof instance.web.form.FieldSelection) { - return _(field.values).find(function (option) { + return _(field.get('values')).find(function (option) { return option[0] === value; })[1]; } else if (field instanceof instance.web.form.FieldMany2One) { @@ -3091,7 +3092,7 @@ instance.web.form.CompletionFieldMixin = { // quick create var raw_result = _(data.result).map(function(x) {return x[1];}); if (search_val.length > 0 && !_.include(raw_result, search_val) && - ! (self.options && self.options.no_quick_create)) { + ! (self.options && (self.options.no_create || self.options.no_quick_create))) { values.push({ label: _.str.sprintf(_t('Create "<strong>%s</strong>"'), $('<span />').text(search_val).html()), @@ -3102,13 +3103,15 @@ instance.web.form.CompletionFieldMixin = { }); } // create... - values.push({ - label: _t("Create and Edit..."), - action: function() { - self._search_create_popup("form", undefined, self._create_context(search_val)); - }, - classname: 'oe_m2o_dropdown_option' - }); + if (!(self.options && self.options.no_create)){ + values.push({ + label: _t("Create and Edit..."), + action: function() { + self._search_create_popup("form", undefined, self._create_context(search_val)); + }, + classname: 'oe_m2o_dropdown_option' + }); + } return values; }); @@ -5129,7 +5132,7 @@ instance.web.form.FieldReference = instance.web.form.AbstractField.extend(instan .on('blurred', null, function () {self.trigger('blurred');}); this.m2o = new instance.web.form.FieldMany2One(fm, { attrs: { - name: 'm2o', + name: 'Referenced Document', modifiers: JSON.stringify({readonly: this.get('effective_readonly')}), }}); this.m2o.on("change:value", this, this.data_changed); |
