From a631a333b0a52b01cc04b72d47cd90f7f781cddd Mon Sep 17 00:00:00 2001 From: std-odoo Date: Mon, 5 Sep 2022 11:55:19 +0000 Subject: [PATCH] [FIX] web: fix the properties field test about many2many Purpose ======= The many2many properties have "res.users" as model, but the model and records were missing in the test data. Task-2965523 X-original-commit: 974999d32e14fcfca94b327fb8d6efa06d6bf06e Part-of: odoo/odoo#101487 --- .../views/fields/properties_field_tests.js | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/addons/web/static/tests/views/fields/properties_field_tests.js b/addons/web/static/tests/views/fields/properties_field_tests.js index f6fc8a9e044..84e1ff6ea2a 100644 --- a/addons/web/static/tests/views/fields/properties_field_tests.js +++ b/addons/web/static/tests/views/fields/properties_field_tests.js @@ -118,6 +118,26 @@ QUnit.module("Fields", (hooks) => { }, ], }, + 'res.users': { + fields: { + name: { + string: "Name", + type: "char", + }, + }, + records: [ + { + id: 1, + display_name: "Alice", + }, { + id: 2, + display_name: "Bob", + }, { + id: 3, + display_name: "Eve", + }, + ], + }, }, }; @@ -759,9 +779,8 @@ QUnit.module("Fields", (hooks) => { /** * Test the properties many2many - * FIXME: broken by mighty TDE */ - QUnit.skip("properties: many2many", async function (assert) { + QUnit.test("properties: many2many", async function (assert) { async function mockRPC(route, { method, model, args, kwargs }) { if (method === "check_access_rights") { return true; @@ -770,6 +789,8 @@ QUnit.module("Fields", (hooks) => { { model: "res.partner", display_name: "Partner" }, { model: "res.users", display_name: "User" }, ]; + } else if (method === "display_name_for" && model === "ir.model" && args[0][0] === "res.users") { + return [{"display_name": "User", "model": "res.users"}] } else if (method === "name_create" && model === "res.users") { // Add a prefix to check that "name_create" // has been called with the right parameters