[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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user