[IMP] view_form: fieldstatus: deprecated folded on widget
bzr revid: tde@openerp.com-20131023120804-vx7etkzewkgx9sk0
This commit is contained in:
parent
b7a7cf5fb9
commit
833c1f2072
|
@ -5520,30 +5520,30 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({
|
||||||
|
|
||||||
var calculation = _.bind(function() {
|
var calculation = _.bind(function() {
|
||||||
if (this.field.type == "many2one") {
|
if (this.field.type == "many2one") {
|
||||||
return self.get_distant_fields().then(function(fields) {
|
/* :deprecated: fold feature will probably be removed */
|
||||||
return new instance.web.DataSetSearch(self, self.field.relation, self.build_context(), self.get("evaluated_selection_domain"))
|
// return self.get_distant_fields().then(function(fields) {
|
||||||
.read_slice(_.union(_.keys(self.distant_fields), ['id']), {}).then(function (records) {
|
self.distant_fields = {};
|
||||||
var ids = _.pluck(records, 'id');
|
return new instance.web.DataSetSearch(self, self.field.relation, self.build_context(), self.get("evaluated_selection_domain"))
|
||||||
|
.read_slice(_.union(_.keys(self.distant_fields), ['id']), {}).then(function (records) {
|
||||||
// var ids = _.map(records, function (val) {return val.id;});
|
var ids = _.pluck(records, 'id');
|
||||||
return self.dataset.name_get(ids).then(function (records_name) {
|
return self.dataset.name_get(ids).then(function (records_name) {
|
||||||
_.each(records, function (record) {
|
_.each(records, function (record) {
|
||||||
var name = _.find(records_name, function (val) {return val[0] == record.id;})[1];
|
var name = _.find(records_name, function (val) {return val[0] == record.id;})[1];
|
||||||
var widget_item = {
|
var widget_item = {
|
||||||
'id': record.id,
|
'id': record.id,
|
||||||
'name': name,
|
'name': name,
|
||||||
'bar_color': record.bar_color || 0,
|
/* :deprecated: should probably be removed */
|
||||||
'bar_fold': record.bar_fold || false,
|
'bar_color': record.bar_color || 0,
|
||||||
}
|
'bar_fold': record.bar_fold || false,
|
||||||
if (record.bar_fold && record.id != self.get('value')) {
|
}
|
||||||
selection_folded.push(widget_item);
|
if (record.bar_fold && record.id != self.get('value')) {
|
||||||
} else {
|
selection_folded.push(widget_item);
|
||||||
selection_unfolded.push(widget_item);
|
} else {
|
||||||
}
|
selection_unfolded.push(widget_item);
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// For field type selection filter values according to
|
// For field type selection filter values according to
|
||||||
// statusbar_visible attribute of the field. For example:
|
// statusbar_visible attribute of the field. For example:
|
||||||
|
@ -5565,6 +5565,9 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/*
|
||||||
|
* :deprecated: this feature will probably be removed with OpenERP v8
|
||||||
|
*/
|
||||||
get_distant_fields: function() {
|
get_distant_fields: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
if (this.distant_fields) {
|
if (this.distant_fields) {
|
||||||
|
|
Loading…
Reference in New Issue