diff options
| author | Alexandre Kühn <aku@odoo.com> | 2017-11-17 11:31:37 +0100 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2017-11-17 12:34:25 +0100 |
| commit | 11ff01af9b3887e7ec70dae204cd0d2c1bc0f8f0 (patch) | |
| tree | 68257737286e7691c997d1fe8b21cd877c9857dc /addons/web/static/src/js/views | |
| parent | 76e75be02f3aa7fa1b965475f18e0f1c31fb910d (diff) | |
[FIX] web: delete attribute on list view
Before this fix, when adding the attribute delete=0
on a listview, it was still possible to delete records
via the menu 'Delete' in the sidebar.
After this fix, this should not be possible to delete
records when delete=0.
The attribute delete was hard-coded to true, as there was
a traceback when it was set to false. It was simply due
to a misplaced closing brackets that was hiding an
assignment, which resulted to calling a method on undefined.
Diffstat (limited to 'addons/web/static/src/js/views')
| -rw-r--r-- | addons/web/static/src/js/views/list/list_controller.js | 2 | ||||
| -rw-r--r-- | addons/web/static/src/js/views/list/list_view.js | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/addons/web/static/src/js/views/list/list_controller.js b/addons/web/static/src/js/views/list/list_controller.js index 67cc6271509..5c6b7ea414d 100644 --- a/addons/web/static/src/js/views/list/list_controller.js +++ b/addons/web/static/src/js/views/list/list_controller.js @@ -148,6 +148,7 @@ var ListController = BasicController.extend({ label: _t('Delete'), callback: this._onDeleteSelectedRecords.bind(this) }); + } this.sidebar = new Sidebar(this, { editable: this.is_action_enabled('edit'), env: { @@ -157,7 +158,6 @@ var ListController = BasicController.extend({ }, actions: _.extend(this.toolbarActions, {other: other}), }); - } this.sidebar.appendTo($node); this._toggleSidebar(); diff --git a/addons/web/static/src/js/views/list/list_view.js b/addons/web/static/src/js/views/list/list_view.js index 61612282bf5..b2295affb98 100644 --- a/addons/web/static/src/js/views/list/list_view.js +++ b/addons/web/static/src/js/views/list/list_view.js @@ -42,7 +42,6 @@ var ListView = BasicView.extend({ this.controllerParams.editable = arch.attrs.editable; this.controllerParams.hasSidebar = params.sidebar; this.controllerParams.toolbarActions = viewInfo.toolbar; - this.controllerParams.activeActions.delete = true; this.controllerParams.noLeaf = !!this.loadParams.context.group_by_no_leaf; this.controllerParams.mode = mode; |
