3
0
Fork 0

[FIX] Ensure that domain field can be evaluated before creating x2x field

11.0
Benjamin Willig 2017-10-20 12:41:59 +02:00 committed by Pedro M. Baeza
parent 646d5d091e
commit efd1f37161
2 changed files with 12 additions and 1 deletions

View File

@ -5,7 +5,7 @@
{
"name": "Search x2x fields",
"version": "10.0.2.0.2",
"version": "10.0.2.0.3",
"author": "Therp BV, "
"Tecnativa, "
"Odoo Community Association (OCA)",

View File

@ -12,6 +12,7 @@ odoo.define('web_advanced_search_x2x.search_filters', function (require) {
var SearchView = require('web.SearchView');
var data = require('web.data');
var core = require('web.core');
var pyeval = require('web.pyeval');
var X2XAdvancedSearchPropositionMixin = {
template: "web_advanced_search_x2x.proposition",
@ -83,6 +84,16 @@ odoo.define('web_advanced_search_x2x.search_filters', function (require) {
}
var widget = this.x2x_widget();
if (!widget) return;
var field_domain = this.field.domain;
if (typeof field_domain === 'string') {
try {
pyeval.eval('domain', field_domain);
} catch(e) {
this.field.domain = "[]";
}
}
this._x2x_field = new widget(
this,
this.x2x_field_create_options()