diff options
Diffstat (limited to 'addons/web/static/src/js/views')
| -rw-r--r-- | addons/web/static/src/js/views/form_relational_widgets.js | 8 | ||||
| -rw-r--r-- | addons/web/static/src/js/views/list_view.js | 2 | ||||
| -rw-r--r-- | addons/web/static/src/js/views/pivot_view.js | 1 |
3 files changed, 7 insertions, 4 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(); diff --git a/addons/web/static/src/js/views/list_view.js b/addons/web/static/src/js/views/list_view.js index 572fcbff95f..b02c91ed147 100644 --- a/addons/web/static/src/js/views/list_view.js +++ b/addons/web/static/src/js/views/list_view.js @@ -1508,7 +1508,7 @@ ListView.Groups = Class.extend({ // drag and drop enabled if list is not sorted (unless it is sorted by // its sequence field (ASC)), and there is a visible column with // @widget=handle or "sequence" column in the view. - if ((dataset.sort && [seqname, seqname + 'ASC', ''].indexOf(dataset.sort()) === -1) + if ((dataset.sort && [seqname, seqname + ' ASC', ''].indexOf(dataset.sort()) === -1) || !_(this.columns).findWhere({'name': seqname})) { return; } diff --git a/addons/web/static/src/js/views/pivot_view.js b/addons/web/static/src/js/views/pivot_view.js index 57c26311acc..95e8d13e5ff 100644 --- a/addons/web/static/src/js/views/pivot_view.js +++ b/addons/web/static/src/js/views/pivot_view.js @@ -57,6 +57,7 @@ var PivotView = View.extend({ this.headers = {}; this.cells = {}; this.has_data = false; + this.$buttons = $(); this.last_header_selected = null; this.sorted_column = {}; |
