[FIX] web: wrap char fields in list views

This fix is similar as 793933a1, but for char fields. It prevents
cells containing char fields with long value from overflowing.

closes odoo/odoo#34739

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
This commit is contained in:
Aaron Bohy
2019-07-15 09:45:31 +00:00
parent 4fc83f62fa
commit aac3059873
3 changed files with 11 additions and 11 deletions
@@ -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',
+3 -4
View File
@@ -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;
}
@@ -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();