diff --git a/addons/web/static/src/js/views/list/list_renderer.js b/addons/web/static/src/js/views/list/list_renderer.js index 2cbaf3a6374..658319fc2e7 100644 --- a/addons/web/static/src/js/views/list/list_renderer.js +++ b/addons/web/static/src/js/views/list/list_renderer.js @@ -25,6 +25,7 @@ var DECORATIONS = [ ]; var FIELD_CLASSES = { + char: 'o_list_char', float: 'o_list_number', integer: 'o_list_number', monetary: 'o_list_number', diff --git a/addons/web/static/src/scss/list_view.scss b/addons/web/static/src/scss/list_view.scss index d1f656fc1e0..8d106308d73 100644 --- a/addons/web/static/src/scss/list_view.scss +++ b/addons/web/static/src/scss/list_view.scss @@ -27,12 +27,10 @@ &.o_list_number { text-align: right; } - &.o_list_text { - white-space: pre-wrap; - } + &.o_list_char, + &.o_list_text, &.o_list_many2one { white-space: pre-wrap; - } } @@ -177,6 +175,7 @@ .o_list_record_remove_header, .o_handle_cell { width: 32px; } + &>tbody>tr>td.o_list_char, &>tbody>tr>td.o_list_many2one { white-space: nowrap; } diff --git a/addons/web/static/tests/fields/relational_fields/field_one2many_tests.js b/addons/web/static/tests/fields/relational_fields/field_one2many_tests.js index f39a5f714a1..02b169d7e12 100644 --- a/addons/web/static/tests/fields/relational_fields/field_one2many_tests.js +++ b/addons/web/static/tests/fields/relational_fields/field_one2many_tests.js @@ -1092,7 +1092,7 @@ QUnit.module('fields', {}, function () { await testUtils.form.clickEdit(form); - assert.equal(form.$('.o_field_one2many td[class="o_data_cell"]').text(), "#20#21#22#23#24#25#26#27#28#29", + assert.equal(form.$('.o_field_one2many .o_list_char').text(), "#20#21#22#23#24#25#26#27#28#29", "should display the records in order"); await testUtils.dom.click(form.$('.o_field_one2many .o_list_view tbody tr:first td:first')); @@ -1101,12 +1101,12 @@ QUnit.module('fields', {}, function () { // the domain fail if the widget does not use the allready loaded data. await testUtils.form.clickDiscard(form); - assert.equal(form.$('.o_field_one2many td[class="o_data_cell"]').text(), "blurp#21#22#23#24#25#26#27#28#29", + assert.equal(form.$('.o_field_one2many .o_list_char').text(), "blurp#21#22#23#24#25#26#27#28#29", "should display the records in order with the changes"); await testUtils.dom.click($('.modal .modal-footer button:first')); - assert.equal(form.$('.o_field_one2many td[class="o_data_cell"]').text(), "#20#21#22#23#24#25#26#27#28#29", + assert.equal(form.$('.o_field_one2many .o_list_char').text(), "#20#21#22#23#24#25#26#27#28#29", "should cancel changes and display the records in order"); await testUtils.form.clickEdit(form); @@ -1118,7 +1118,7 @@ QUnit.module('fields', {}, function () { { position: 'top' } ); - assert.equal(form.$('.o_field_one2many td[class="o_data_cell"]').text(), "#20#30#31#32#33#34#35#36#37#38", + assert.equal(form.$('.o_field_one2many .o_list_char').text(), "#20#30#31#32#33#34#35#36#37#38", "should display the records in order after resequence (display record with turtle_int=0)"); // Drag and drop the third line in second position @@ -1128,17 +1128,17 @@ QUnit.module('fields', {}, function () { { position: 'top' } ); - assert.equal(form.$('.o_field_one2many td[class="o_data_cell"]').text(), "#20#39#40#41#42#43#44#45#46#47", + assert.equal(form.$('.o_field_one2many .o_list_char').text(), "#20#39#40#41#42#43#44#45#46#47", "should display the records in order after resequence (display record with turtle_int=0)"); await testUtils.form.clickDiscard(form); - assert.equal(form.$('.o_field_one2many td[class="o_data_cell"]').text(), "#20#39#40#41#42#43#44#45#46#47", + assert.equal(form.$('.o_field_one2many .o_list_char').text(), "#20#39#40#41#42#43#44#45#46#47", "should display the records in order after resequence"); await testUtils.dom.click($('.modal .modal-footer button:first')); - assert.equal(form.$('.o_field_one2many td[class="o_data_cell"]').text(), "#20#21#22#23#24#25#26#27#28#29", + assert.equal(form.$('.o_field_one2many .o_list_char').text(), "#20#21#22#23#24#25#26#27#28#29", "should cancel changes and display the records in order"); form.destroy();