diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-02-10 13:17:02 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-02-10 13:17:02 +0100 |
| commit | cbdd0b20dcfe1f46706c631262b4eab9996f4eb7 (patch) | |
| tree | cfbe4fd881f9b80ed1da3bca84022607095f5f2d /addons/web/static/src/js/views/form_relational_widgets.js | |
| parent | 3fbaa6c409278014797ce55c6841055b1364d625 (diff) | |
| parent | ffd4442b06bc679a79b107c72806f57da3500d3f (diff) | |
[MERGE] forward port branch 10.0 up to ffd4442b06b
Diffstat (limited to 'addons/web/static/src/js/views/form_relational_widgets.js')
| -rw-r--r-- | addons/web/static/src/js/views/form_relational_widgets.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/addons/web/static/src/js/views/form_relational_widgets.js b/addons/web/static/src/js/views/form_relational_widgets.js index 46136e21565..06bca6cd382 100644 --- a/addons/web/static/src/js/views/form_relational_widgets.js +++ b/addons/web/static/src/js/views/form_relational_widgets.js @@ -26,7 +26,7 @@ var M2ODialog = Dialog.extend({ title: _.str.sprintf(_t("Create a %s"), parent.string), size: 'medium', buttons: [ - {text: _t('Create'), classes: 'btn-primary', click: function() { + {text: _t('Create'), classes: 'btn-primary', click: function(e) { if (this.$("input").val() !== ''){ this.getParent()._quick_create(this.$("input").val()); this.close(); @@ -997,7 +997,9 @@ var X2ManyListView = ListView.extend({ */ var X2ManyList = ListView.List.extend({ pad_table_to: function (count) { - if (!this.view.is_action_enabled('create') || this.view.x2m.get('effective_readonly')) { + var ftype = this.view.x2m.field.type; + var is_readonly = this.view.x2m.get('effective_readonly'); + if (is_readonly || (ftype === 'one2many' && !this.view.is_action_enabled('create'))) { this._super(count); return; } @@ -1304,7 +1306,7 @@ var Many2ManyListView = X2ManyListView.extend({ context: this.x2m.build_context(), title: _t("Add: ") + this.x2m.string, alternative_form_view: this.x2m.field.views ? this.x2m.field.views.form : undefined, - no_create: this.x2m.options.no_create, + no_create: this.x2m.options.no_create || !this.is_action_enabled('create'), on_selected: function(element_ids) { return self.x2m.data_link_multi(element_ids).then(function() { self.x2m.reload_current_view(); |
