summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/fields/relational_fields_tests.js
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_tests.js
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_tests.js')
-rw-r--r--addons/web/static/tests/fields/relational_fields_tests.js21
1 files changed, 11 insertions, 10 deletions
diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js
index 96bd4a4d633..406370b0a2b 100644
--- a/addons/web/static/tests/fields/relational_fields_tests.js
+++ b/addons/web/static/tests/fields/relational_fields_tests.js
@@ -2758,7 +2758,7 @@ QUnit.module('relational_fields', {
View: FormView,
model: 'partner',
data: this.data,
- arch:'<form string="Partners">' +
+ arch: '<form string="Partners">' +
'<sheet>' +
'<group>' +
'<field name="product_id"/>' +
@@ -2783,14 +2783,14 @@ QUnit.module('relational_fields', {
await testUtils.form.clickEdit(form);
await testUtils.fields.many2one.clickOpenDropdown("product_id");
await testUtils.fields.many2one.clickHighlightedItem("product_id");
- 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();
});
@@ -2812,7 +2812,7 @@ QUnit.module('relational_fields', {
View: FormView,
model: 'partner',
data: this.data,
- arch:'<form>' +
+ arch: '<form>' +
'<field name="bar"/>' +
'<field name="p">' +
'<tree editable="bottom">' +
@@ -2837,7 +2837,8 @@ QUnit.module('relational_fields', {
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();
});
@@ -2850,7 +2851,7 @@ QUnit.module('relational_fields', {
View: FormView,
model: 'partner',
data: this.data,
- arch:'<form string="Partners">' +
+ arch: '<form string="Partners">' +
'<sheet>' +
'<group>' +
'<field name="product_id"/>' +
@@ -2876,14 +2877,14 @@ QUnit.module('relational_fields', {
await testUtils.form.clickEdit(form);
await testUtils.dom.click(form.$('.o_field_many2one[name="product_id"] input'));
await testUtils.fields.many2one.clickHighlightedItem("product_id");
- 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();
});