summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/fields/relational_fields
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2019-03-18 14:51:04 +0000
committerAaron Bohy <aab@odoo.com>2019-04-02 11:55:57 +0000
commit9fbb4fb44ff92cdee53454ab328c10ae66a11aa0 (patch)
tree5fd611cbf41a582951250558ff1055ffe9fba9fe /addons/web/static/tests/fields/relational_fields
parenta75fa7e377829ac22f85eab3bfefd79705458236 (diff)
[IMP] web: editable list: table-layout: fixed
This rev. changes the layout of *editable* list views to a fixed layout. This means that we are now responsible of the width of each column. To do that, we associate with each field type a factor, and the higher the factor is, the larger the column will be (w.r.t. the others). This default value can be overriden in the arch. The fixed layout allows to remove the absolute positionning of widgets inside editable lists (done in the next commit). Part of task 1915702 Co-authored-by: Martin Geubelle <mge@odoo.com>
Diffstat (limited to 'addons/web/static/tests/fields/relational_fields')
-rw-r--r--addons/web/static/tests/fields/relational_fields/field_many2one_tests.js14
-rw-r--r--addons/web/static/tests/fields/relational_fields/field_one2many_tests.js20
2 files changed, 17 insertions, 17 deletions
diff --git a/addons/web/static/tests/fields/relational_fields/field_many2one_tests.js b/addons/web/static/tests/fields/relational_fields/field_many2one_tests.js
index 4f2a3d03bed..419d7c5a4c7 100644
--- a/addons/web/static/tests/fields/relational_fields/field_many2one_tests.js
+++ b/addons/web/static/tests/fields/relational_fields/field_many2one_tests.js
@@ -2915,14 +2915,14 @@ QUnit.module('fields', {}, function () {
await testUtils.form.clickEdit(form);
await testUtils.dom.click(form.$('.o_field_many2one[name="product_id"] input'));
await testUtils.dom.click($('li.ui-menu-item a:contains(xpad)').trigger('mouseenter'));
- assert.containsOnce(form, 'th',
+ assert.containsOnce(form, 'th:not(.o_list_record_remove_header)',
"should be 1 column when the product_id is set");
await testUtils.fields.editAndTrigger(form.$('.o_field_many2one[name="product_id"] input'),
'', 'keyup');
- assert.containsN(form, 'th', 2,
+ assert.containsN(form, 'th:not(.o_list_record_remove_header)', 2,
"should be 2 columns in the one2many when product_id is not set");
await testUtils.dom.click(form.$('.o_field_boolean[name="bar"] input'));
- assert.containsOnce(form, 'th',
+ assert.containsOnce(form, 'th:not(.o_list_record_remove_header)',
"should be 1 column after the value change");
form.destroy();
});
@@ -2969,7 +2969,7 @@ QUnit.module('fields', {}, function () {
await testUtils.fields.editInput(form.$('.o_field_one2many input:first'), 'New line');
await testUtils.dom.click(form.$el);
- assert.containsN(form, 'th', 2, "should be 2 columns('foo' + 'int_field')");
+ assert.containsN(form, 'th:not(.o_list_record_remove_header)', 2, "should be 2 columns('foo' + 'int_field')");
form.destroy();
});
@@ -3008,14 +3008,14 @@ QUnit.module('fields', {}, function () {
await testUtils.form.clickEdit(form);
await testUtils.dom.click(form.$('.o_field_many2one[name="product_id"] input'));
await testUtils.dom.click($('li.ui-menu-item a:contains(xpad)').trigger('mouseenter'));
- assert.containsOnce(form, 'th',
+ assert.containsOnce(form, 'th:not(.o_list_record_remove_header)',
"should be 1 column when the product_id is set");
await testUtils.fields.editAndTrigger(form.$('.o_field_many2one[name="product_id"] input'),
'', 'keyup');
- assert.containsN(form, 'th', 2,
+ assert.containsN(form, 'th:not(.o_list_record_remove_header)', 2,
"should be 2 columns in the one2many when product_id is not set");
await testUtils.dom.click(form.$('.o_field_boolean[name="bar"] input'));
- assert.containsOnce(form, 'th',
+ assert.containsOnce(form, 'th:not(.o_list_record_remove_header)',
"should be 1 column after the value change");
form.destroy();
});
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 fa83e91bfbe..85975d99231 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
@@ -831,10 +831,10 @@ QUnit.module('fields', {}, function () {
'The right values should be written');
}
return this._super.apply(this, arguments);
- }
+ },
});
- assert.deepEqual(form.$('.o_many2many_tags_cell').text().trim(), "second record",
+ assert.deepEqual(form.$('.o_data_cell.o_many2many_tags_cell').text().trim(), "second record",
"the partner_ids should be as specified at initialization");
await testUtils.form.clickEdit(form);
@@ -843,7 +843,7 @@ QUnit.module('fields', {}, function () {
await testUtils.fields.editSelect($cell, "hop");
await testUtils.form.clickSave(form);
- assert.deepEqual(form.$('.o_many2many_tags_cell').text().trim().split(/\s+/),
+ assert.deepEqual(form.$('.o_data_cell.o_many2many_tags_cell').text().trim().split(/\s+/),
["second", "record", "aaa"],
'The partner_ids should have been updated');
@@ -8153,14 +8153,14 @@ QUnit.module('fields', {}, function () {
await testUtils.form.clickEdit(form);
await testUtils.dom.click(form.$('.o_field_many2one[name="product_id"] input'));
await testUtils.dom.click($('li.ui-menu-item a:contains(xpad)').trigger('mouseenter'));
- assert.containsOnce(form, 'th',
+ assert.containsOnce(form, 'th:not(.o_list_record_remove_header)',
"should be 1 column when the product_id is set");
await testUtils.fields.editAndTrigger(form.$('.o_field_many2one[name="product_id"] input'),
'', 'keyup');
- assert.containsN(form, 'th', 2,
+ assert.containsN(form, 'th:not(.o_list_record_remove_header)', 2,
"should be 2 columns in the one2many when product_id is not set");
await testUtils.dom.click(form.$('.o_field_boolean[name="bar"] input'));
- assert.containsOnce(form, 'th',
+ assert.containsOnce(form, 'th:not(.o_list_record_remove_header)',
"should be 1 column after the value change");
form.destroy();
});
@@ -8207,7 +8207,7 @@ QUnit.module('fields', {}, function () {
await testUtils.fields.editInput(form.$('.o_field_one2many input:first'), 'New line');
await testUtils.dom.click(form.$el);
- assert.containsN(form, 'th', 2, "should be 2 columns('foo' + 'int_field')");
+ assert.containsN(form, 'th:not(.o_list_record_remove_header)', 2, "should be 2 columns('foo' + 'int_field')");
form.destroy();
});
@@ -8246,14 +8246,14 @@ QUnit.module('fields', {}, function () {
await testUtils.form.clickEdit(form);
await testUtils.dom.click(form.$('.o_field_many2one[name="product_id"] input'));
await testUtils.dom.click($('li.ui-menu-item a:contains(xpad)').trigger('mouseenter'));
- assert.containsOnce(form, 'th',
+ assert.containsOnce(form, 'th:not(.o_list_record_remove_header)',
"should be 1 column when the product_id is set");
await testUtils.fields.editAndTrigger(form.$('.o_field_many2one[name="product_id"] input'),
'', 'keyup');
- assert.containsN(form, 'th', 2,
+ assert.containsN(form, 'th:not(.o_list_record_remove_header)', 2,
"should be 2 columns in the one2many when product_id is not set");
await testUtils.dom.click(form.$('.o_field_boolean[name="bar"] input'));
- assert.containsOnce(form, 'th',
+ assert.containsOnce(form, 'th:not(.o_list_record_remove_header)',
"should be 1 column after the value change");
form.destroy();
});