summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/fields/relational_fields_tests.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-03-13 11:45:01 +0000
committerChristophe Simonis <chs@odoo.com>2019-03-13 14:24:51 +0000
commit44515bc7beae3b4c46b5bc2959c320695b51439d (patch)
tree5f56871242f7b5bc8a323c51f2749411e555159e /addons/web/static/tests/fields/relational_fields_tests.js
parentbf69975b54164a21bfe00b2359d972329516a34e (diff)
parentc9f832d9f032b6af51807b387b325b5c2b8aad00 (diff)
[MERGE] forward port branch saas-12.2 up to c9f832d9f03
closes odoo/odoo#31790 Signed-off-by: Christophe Simonis <chs@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.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js
index af64afbb9e4..e8d89aaf00d 100644
--- a/addons/web/static/tests/fields/relational_fields_tests.js
+++ b/addons/web/static/tests/fields/relational_fields_tests.js
@@ -1265,6 +1265,30 @@ QUnit.module('relational_fields', {
form.destroy();
});
+ QUnit.test('fieldmany2many tags in tree view', async function (assert) {
+ assert.expect(3);
+
+ this.data.partner.records[0].timmy = [12, 14];
+ var list = await createView({
+ View: ListView,
+ model: 'partner',
+ data: this.data,
+ arch: '<tree string="Partners">' +
+ '<field name="timmy" widget="many2many_tags" options="{\'color_field\': \'color\'}"/>' +
+ '</tree>',
+ });
+ assert.containsN(list, '.o_field_many2manytags .badge', 2, "there should be 2 tags");
+ assert.containsNone(list, '.badge.dropdown-toggle', "the tags should not be dropdowns");
+
+ testUtils.intercept(list, 'switch_view', function (event) {
+ assert.strictEqual(event.data.view_type, "form", "should switch to form view");
+ });
+ // click on the tag: should do nothing and open the form view
+ testUtils.dom.click(list.$('.o_field_many2manytags .badge:first'));
+
+ list.destroy();
+ });
+
QUnit.test('fieldmany2many tags view a domain', async function (assert) {
assert.expect(7);