From 80dec11b151ba83d56d5ccd5c9ee7030ddf84b08 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Tue, 1 Jun 2021 17:43:54 +0200 Subject: [PATCH] [FIX] web: mockServer: push a mock view name in fieldviewGet In the new mockServer, we add a name to a view (field name on ir.ui.view) when the found view in `fieldsViewGet` has an id. In tests data, one would normally specify default views like ```js views = { "partner,false,form": `
`, } ``` In this case and from the point of view of the business code, the view doesn't really exist in DB On the contrary, if a developer writes, in a test: ```js views = { "partner,999,form": `
`, } ``` The returned view from load_views will return that view with ID 999 and, from the business code standpoint, the view would exist in DB. This is particularly important in studio when it has to fetch a x2m view when none has been inlined in the main view. --- addons/web/static/tests/helpers/mock_server.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/web/static/tests/helpers/mock_server.js b/addons/web/static/tests/helpers/mock_server.js index de34f8e7280..5d23c449867 100644 --- a/addons/web/static/tests/helpers/mock_server.js +++ b/addons/web/static/tests/helpers/mock_server.js @@ -145,6 +145,7 @@ export class MockServer { } if (viewId) { fvg.view_id = viewId; + fvg.name = key; } return fvg; }