[IMP] added 'always_reload' option to m2o
bzr revid: nicolas.vanhoren@openerp.com-20120628125242-t3pf093fe88nrv8k
This commit is contained in:
parent
335f198eed
commit
4f6e8b25e1
|
@ -2448,7 +2448,7 @@ instance.web.form.CompletionFieldMixin = {
|
||||||
|
|
||||||
return this.orderer.add(dataset.name_search(
|
return this.orderer.add(dataset.name_search(
|
||||||
search_val, new instance.web.CompoundDomain(self.build_domain(), [["id", "not in", blacklist]]),
|
search_val, new instance.web.CompoundDomain(self.build_domain(), [["id", "not in", blacklist]]),
|
||||||
'ilike', this.limit + 1)).pipe(function(data) {
|
'ilike', this.limit + 1, self.build_context())).pipe(function(data) {
|
||||||
self.last_search = data;
|
self.last_search = data;
|
||||||
// possible selections for the m2o
|
// possible selections for the m2o
|
||||||
var values = _.map(data, function(x) {
|
var values = _.map(data, function(x) {
|
||||||
|
@ -2710,7 +2710,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (! no_recurse) {
|
if (! no_recurse) {
|
||||||
var dataset = new instance.web.DataSetStatic(this, this.field.relation, self.view.dataset.get_context());
|
var dataset = new instance.web.DataSetStatic(this, this.field.relation, self.build_context());
|
||||||
dataset.name_get([self.get("value")], function(data) {
|
dataset.name_get([self.get("value")], function(data) {
|
||||||
self.display_value["" + self.get("value")] = data[0][1];
|
self.display_value["" + self.get("value")] = data[0][1];
|
||||||
self.render_value(true);
|
self.render_value(true);
|
||||||
|
@ -2743,7 +2743,9 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
|
||||||
var self = this;
|
var self = this;
|
||||||
if (value_ instanceof Array) {
|
if (value_ instanceof Array) {
|
||||||
this.display_value = {};
|
this.display_value = {};
|
||||||
this.display_value["" + value_[0]] = value_[1];
|
if (! this.get_definition_options().always_reload) {
|
||||||
|
this.display_value["" + value_[0]] = value_[1];
|
||||||
|
}
|
||||||
value_ = value_[0];
|
value_ = value_[0];
|
||||||
}
|
}
|
||||||
value_ = value_ || false;
|
value_ = value_ || false;
|
||||||
|
|
Loading…
Reference in New Issue