mirror of https://github.com/OCA/web.git
Fix issue when query result not in the same order as values
parent
f6070e7cf1
commit
d6ba0a680a
|
@ -116,10 +116,17 @@ openerp.web_m2x_options = function (instance) {
|
||||||
.filter([['id', 'in', value_ids]])
|
.filter([['id', 'in', value_ids]])
|
||||||
.all().done(function (objects) {
|
.all().done(function (objects) {
|
||||||
for (var index in objects) {
|
for (var index in objects) {
|
||||||
var value = values[index];
|
for (var index_value in values) {
|
||||||
// Find color with field value as key
|
if (values[index_value].id == objects[index].id) {
|
||||||
var color = self.colors[objects[index][self.field_color]] || 'black';
|
// Find value in values by comparing ids
|
||||||
value.label = '<span style="color:'+color+'">'+value.label+'</span>';
|
var value = values[index_value];
|
||||||
|
|
||||||
|
// Find color with field value as key
|
||||||
|
var color = self.colors[objects[index][self.field_color]] || 'black';
|
||||||
|
value.label = '<span style="color:'+color+'">'+value.label+'</span>';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
def.resolve(values);
|
def.resolve(values);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue