summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/views/kanban_tests.js
diff options
context:
space:
mode:
authorlen-odoo <len@odoo.com>2018-09-11 08:33:33 +0000
committerlen-odoo <len@odoo.com>2018-10-12 07:51:12 +0000
commit52d779007d0b63fb6c2ae94de095bfe83c5019c1 (patch)
tree3aeebb7727408233364ed79cc832a66b9f7a07ff /addons/web/static/tests/views/kanban_tests.js
parent1ab53c27fffcf27b652163783e5c0ee58bd53232 (diff)
[FIX] web: use read to update record values after resequence
Commit: https://github.com/odoo/odoo/commit/818c18e55d0718286ff5bf332186a10f4d7a58ef Updated the resequence logic in a way that was almost falser than before. The added test however did work by coincidence, as index values were equal to the sequence field values. To be sure that we synchronize with what happens on the server, we do a read after the resequence. Additionnally, we take into account the result of the server resequence return; if it is false, it means no resequencing happened, so we should not do a read. opw 1867049 closes odoo/odoo#27184
Diffstat (limited to 'addons/web/static/tests/views/kanban_tests.js')
-rw-r--r--addons/web/static/tests/views/kanban_tests.js11
1 files changed, 3 insertions, 8 deletions
diff --git a/addons/web/static/tests/views/kanban_tests.js b/addons/web/static/tests/views/kanban_tests.js
index 921cf3655da..1a424c92428 100644
--- a/addons/web/static/tests/views/kanban_tests.js
+++ b/addons/web/static/tests/views/kanban_tests.js
@@ -1241,7 +1241,7 @@ QUnit.module('Views', {
});
QUnit.test('delete a column in grouped on m2o', function (assert) {
- assert.expect(33);
+ assert.expect(36);
testUtils.patch(KanbanRenderer, {
_renderGrouped: function () {
@@ -1858,6 +1858,7 @@ QUnit.module('Views', {
QUnit.test('resequence columns in grouped by m2o', function (assert) {
assert.expect(7);
+ this.data.product.fields.sequence = {string: "Sequence", type: "integer"};
var envIDs = [1, 3, 2, 4]; // the ids that should be in the environment during this test
var kanban = createView({
@@ -1871,12 +1872,6 @@ QUnit.module('Views', {
'</t></templates>' +
'</kanban>',
groupBy: ['product_id'],
- mockRPC: function (route) {
- if (route === '/web/dataset/resequence') {
- return $.when();
- }
- return this._super.apply(this, arguments);
- },
intercepts: {
env_updated: function (event) {
assert.deepEqual(event.data.ids, envIDs,
@@ -1900,7 +1895,7 @@ QUnit.module('Views', {
kanban.update({}, {reload: false}); // re-render without reloading
assert.strictEqual(kanban.$('.o_kanban_group:first').data('id'), 5,
- "first column should be id 5 before resequencing");
+ "first column should be id 5 after resequencing");
kanban.destroy();
});