mirror of https://github.com/OCA/web.git
[FIX] Ensure that domain field can be evaluated before creating x2x field
parent
85d519d937
commit
a76e1ced54
|
@ -12,6 +12,7 @@ odoo.define('web_advanced_search_x2x.search_filters', function (require) {
|
||||||
var SearchView = require('web.SearchView');
|
var SearchView = require('web.SearchView');
|
||||||
var data = require('web.data');
|
var data = require('web.data');
|
||||||
var core = require('web.core');
|
var core = require('web.core');
|
||||||
|
var pyeval = require('web.pyeval');
|
||||||
|
|
||||||
var X2XAdvancedSearchPropositionMixin = {
|
var X2XAdvancedSearchPropositionMixin = {
|
||||||
template: "web_advanced_search_x2x.proposition",
|
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();
|
var widget = this.x2x_widget();
|
||||||
if (!widget) return;
|
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._x2x_field = new widget(
|
||||||
this,
|
this,
|
||||||
this.x2x_field_create_options()
|
this.x2x_field_create_options()
|
||||||
|
|
Loading…
Reference in New Issue