Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
query_records: function() {
var self = this;
var model = new Model(this.field.relation);
this.records_orderer.add(model.call("search", [this.get("domain")], {"context": this.build_context()}).then(function(record_ids) {
return model.call("name_get", [record_ids] , {"context": self.build_context()});
})).then(function(res) {
self.set("records", res);
});
},
render_value: function() {
query_values: function() {
var self = this;
var def;
if (this.field.type === "many2one") {
var model = new Model(this.field.relation);
def = model.call("name_search", ['', this.get("domain")], {"context": this.build_context()});
} else {
var values = _.reject(this.field.selection, function (v) { return v[0] === false && v[1] === ''; });
def = $.when(values);
}
this.records_orderer.add(def).then(function(values) {
if (! _.isEqual(values, self.get("values"))) {
self.set("values", values);
}
});
},
initialize_content: function() {
query_records: function() {
var self = this;
var model = new Model(this.field.relation);
this.records_orderer.add(model.call("search", [this.get("domain")], {"context": this.build_context()}).then(function(record_ids) {
return model.call("name_get", [record_ids] , {"context": self.build_context()});
})).then(function(res) {
self.set("records", res);
});
},
render_value: function() {
query_values: function() {
var self = this;
var def;
if (this.field.type === "many2one") {
var model = new Model(this.field.relation);
def = model.call("name_search", ['', this.get("domain")], {"context": this.build_context()});
} else {
var values = _.reject(this.field.selection, function (v) { return v[0] === false && v[1] === ''; });
def = $.when(values);
}
this.records_orderer.add(def).then(function(values) {
if (! _.isEqual(values, self.get("values"))) {
self.set("values", values);
}
});
},
initialize_content: function() {