diff options
| author | Alexandre Kühn <aku@odoo.com> | 2018-04-16 14:16:24 +0200 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2018-04-17 17:28:49 +0200 |
| commit | b15e805b5ad40e1e8e08e9be1ba248da66158bc9 (patch) | |
| tree | 0bc93c17c8c161c1fa6ab3eab5130a3039a98a9f /addons/board/static | |
| parent | cd934f307de19b247bf88b9dc41a8fdea15fd23c (diff) | |
[FIX] board,web: edit custom views in place
Before this commit, whenever we do an operation on any of these custom views,
such as folding it, the custom view was saved by creating a new one.
This behaviour comes from a lost feature to undo operations on custom views.
Since we do not have this feature anymore, it makes no sense to create new
custom views on save, instead of applying the changes in place.
With this commit, custom views are edited in place.
Fixes #23712
Diffstat (limited to 'addons/board/static')
| -rw-r--r-- | addons/board/static/src/js/dashboard.js | 8 | ||||
| -rw-r--r-- | addons/board/static/tests/dashboard_tests.js | 16 |
2 files changed, 12 insertions, 12 deletions
diff --git a/addons/board/static/src/js/dashboard.js b/addons/board/static/src/js/dashboard.js index ee8f720a9df..09c9c4e2559 100644 --- a/addons/board/static/src/js/dashboard.js +++ b/addons/board/static/src/js/dashboard.js @@ -20,7 +20,7 @@ FormView.include({ */ init: function (viewInfo) { this._super.apply(this, arguments); - this.controllerParams.viewID = viewInfo.view_id; + this.controllerParams.customViewID = viewInfo.custom_view_id; }, }); @@ -33,7 +33,7 @@ FormController.include({ }), init: function (parent, model, renderer, params) { this._super.apply(this, arguments); - this.viewID = params.viewID; + this.customViewID = params.customViewID; }, //-------------------------------------------------------------------------- @@ -63,9 +63,9 @@ FormController.include({ var board = this.renderer.getBoard(); var arch = QWeb.render('DashBoard.xml', _.extend({}, board)); return this._rpc({ - route: '/web/view/add_custom', + route: '/web/view/edit_custom', params: { - view_id: this.viewID, + custom_id: this.customViewID, arch: arch, } }).then(dataManager.invalidate.bind(dataManager)); diff --git a/addons/board/static/tests/dashboard_tests.js b/addons/board/static/tests/dashboard_tests.js index 4a6f25f5950..505883a5f4b 100644 --- a/addons/board/static/tests/dashboard_tests.js +++ b/addons/board/static/tests/dashboard_tests.js @@ -124,8 +124,8 @@ QUnit.test('basic functionality, with one sub action', function (assert) { if (route === '/web/dataset/search_read') { assert.deepEqual(args.domain, [['foo', '!=', 'False']], "the domain should be passed"); } - if (route === '/web/view/add_custom') { - assert.step('add custom'); + if (route === '/web/view/edit_custom') { + assert.step('edit custom'); return $.when(true); } return this._super.apply(this, arguments); @@ -156,7 +156,7 @@ QUnit.test('basic functionality, with one sub action', function (assert) { form.$('.oe_fold').click(); assert.ok(form.$('.oe_content').is(':visible'), "content is visible again"); - assert.verifySteps(['load action', 'add custom', 'add custom']); + assert.verifySteps(['load action', 'edit custom', 'edit custom']); assert.strictEqual($('.modal').length, 0, "should have no modal open"); @@ -184,7 +184,7 @@ QUnit.test('basic functionality, with one sub action', function (assert) { assert.strictEqual($('.modal').length, 0, "should have no modal open"); assert.strictEqual(form.$('.oe_action').length, 0, "should have no displayed action"); - assert.verifySteps(['load action', 'add custom', 'add custom', 'add custom', 'add custom']); + assert.verifySteps(['load action', 'edit custom', 'edit custom', 'edit custom', 'edit custom']); form.destroy(); }); @@ -293,8 +293,8 @@ QUnit.test('can drag and drop a view', function (assert) { views: [[4, 'list']], }); } - if (route === '/web/view/add_custom') { - assert.step('add custom'); + if (route === '/web/view/edit_custom') { + assert.step('edit custom'); return $.when(true); } return this._super.apply(this, arguments); @@ -340,8 +340,8 @@ QUnit.test('twice the same action in a dashboard', function (assert) { views: [[4, 'list'],[5, 'kanban']], }); } - if (route === '/web/view/add_custom') { - assert.step('add custom'); + if (route === '/web/view/edit_custom') { + assert.step('edit custom'); return $.when(true); } return this._super.apply(this, arguments); |
