[IMP] desactivate sorting in list view with function fields with store=false

lp bug: https://launchpad.net/bugs/1095664 fixed

bzr revid: nicolas.vanhoren@openerp.com-20130103144651-qcxmp0bphkylp9s2
This commit is contained in:
niv-openerp 2013-01-03 15:46:51 +01:00
parent 5469b4709b
commit 4f07a4c7af
1 changed files with 8 additions and 1 deletions

View File

@ -361,7 +361,14 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
sort_by_column: function (e) {
e.stopPropagation();
var $column = $(e.currentTarget);
this.dataset.sort($column.data('id'));
var col_name = $column.data('id')
var field = this.fields_view.fields[col_name];
// test if the field is a function field with store=false, since it's impossible
// for the server to sort those fields we desactivate the feature
if (field && field.store === false) {
return false;
}
this.dataset.sort(col_name);
if($column.hasClass("sortdown") || $column.hasClass("sortup")) {
$column.toggleClass("sortup sortdown");
} else {