summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/helpers/test_utils.js
diff options
context:
space:
mode:
authorfwi-odoo <fwi@odoo.com>2017-09-07 16:52:29 +0200
committerfwi-odoo <fwi@odoo.com>2017-09-11 16:41:58 +0200
commit68d1e6d8b1363ce551f97ab93f7a7fe5a69fdbb8 (patch)
treef6777dfa7a2e9001c085bcfad35965ed14d1438a /addons/web/static/tests/helpers/test_utils.js
parent268e6d95306dfe7b35b1aff84a79eeab4a4cb230 (diff)
[FIX] web: evaluate the view context for the subviews not inline
Before this commit, the xml attributes defined with 'context.get(key)' in the subviews not inline were not evaluated correctly. This was caused by the loss of the one context in the '_loadSubviews' method. This commit fixes this issue and modifies the mockserver in order to be able to use the parameter 'viewOptions.context'.
Diffstat (limited to 'addons/web/static/tests/helpers/test_utils.js')
-rw-r--r--addons/web/static/tests/helpers/test_utils.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/addons/web/static/tests/helpers/test_utils.js b/addons/web/static/tests/helpers/test_utils.js
index f7003faaf5c..d97b51e68c4 100644
--- a/addons/web/static/tests/helpers/test_utils.js
+++ b/addons/web/static/tests/helpers/test_utils.js
@@ -129,7 +129,7 @@ function createAsyncView(params) {
// add mock environment: mock server, session, fieldviewget, ...
var mockServer = addMockEnvironment(widget, params);
- var viewInfo = mockServer.fieldsViewGet(params.arch, params.model, params.toolbar);
+ var viewInfo = mockServer.fieldsViewGet(params);
// create the view
var viewOptions = {
@@ -321,10 +321,17 @@ function addMockEnvironment(widget, params) {
var view_type = view_descr[1];
var key = [model, view_id, view_type].join(',');
var arch = params.archs[key];
+ var viewParams = {
+ arch: arch,
+ model: model,
+ viewOptions: {
+ context: event.data.context.eval(),
+ },
+ };
if (!arch) {
throw new Error('No arch found for key ' + key);
}
- views[view_type] = mockServer.fieldsViewGet(arch, model);
+ views[view_type] = mockServer.fieldsViewGet(viewParams);
});
event.data.on_success(views);