[FIX]Fixed the issue of o2m sorting by column, m2o field does not give proper result for sorting because whole value of m2o [id, value] going to compare for sorting.

bzr revid: msh@openerp.com-20140304110659-4uu38feetsjj0tt5
This commit is contained in:
Mohammed Shekha (OpenERP) 2014-03-04 16:36:59 +05:30
parent 9cc13d4216
commit f29f1e6f04
1 changed files with 4 additions and 0 deletions

View File

@ -877,6 +877,10 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({
sign = -1;
field = field.slice(1);
}
//m2o should be searched based on value[1] not based whole value(i.e. [id, value])
if(_.isArray(a[field]) && a[field].length == 2 && _.isString(a[field][1])){
return sign * compare(a[field][1], b[field][1]);
}
return sign * compare(a[field], b[field]);
}, 0);
});