summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/view_dialogs.js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2017-11-06 09:52:33 +0100
committerAaron Bohy <aab@odoo.com>2017-11-07 15:33:23 +0100
commit0f638b3c6315d2cf60109de171bba92c6a28b6c4 (patch)
treea83abde79d915c0ecad4d15ddf1c4b37b474b7df /addons/web/static/src/js/views/view_dialogs.js
parent255478acbd66f01daf32422636f09f2014ebc9f8 (diff)
[FIX] web: correctly evaluate domains and contexts in dialogs
An error occurred if the domain or context applied on a view opened in a dialog needed to be evaluated (e.g. if they contained something like [['some_field', '=', uid]]). For instance, create a custom filter with such a domain for the Contact model, then go to Contact, create a new one, and on the parent_id many2one, click on search more. Before this rev, no eval context was given so the domains and contexts couldn't be evaluated, and it crashed.
Diffstat (limited to 'addons/web/static/src/js/views/view_dialogs.js')
-rw-r--r--addons/web/static/src/js/views/view_dialogs.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/view_dialogs.js b/addons/web/static/src/js/views/view_dialogs.js
index 645540b7a57..da3fc94f2ce 100644
--- a/addons/web/static/src/js/views/view_dialogs.js
+++ b/addons/web/static/src/js/views/view_dialogs.js
@@ -396,7 +396,8 @@ var SelectCreateDialog = ViewDialog.extend({
var results = pyeval.eval_domains_and_contexts({
domains: [this.domain].concat(domains),
contexts: [this.context].concat(contexts),
- group_by_seq: groupbys || []
+ group_by_seq: groupbys || [],
+ eval_context: this.getSession().user_context,
});
var context = _.omit(results.context, function (value, key) { return key.indexOf('search_default_') === 0; });
return {