[FIX] list view: display group titles straight from read_group if we fail to format them

read_group plays fast and loose with formats, and apparently has no
problem returning arbitrary strings for date columns, arbitrary
strings which may very well be completely unparseable.

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

bzr revid: xmo@openerp.com-20111110152850-o31j3r4u5gdugznw
This commit is contained in:
Xavier Morel 2011-11-10 16:28:50 +01:00
parent 78dec879cf
commit 48499f2e0a
1 changed files with 6 additions and 3 deletions

View File

@ -1145,9 +1145,12 @@ openerp.web.ListView.Groups = openerp.web.Class.extend( /** @lends openerp.web.L
row_data[group.grouped_on] = group;
var group_column = _(self.columns).detect(function (column) {
return column.id === group.grouped_on; });
$group_column.html(openerp.web.format_cell(
row_data, group_column, _t("Undefined")
));
try {
$group_column.html(openerp.web.format_cell(
row_data, group_column, _t("Undefined")));
} catch (e) {
$group_column.html(row_data[group_column.id].value);
}
if (group.openable) {
// Make openable if not terminal group & group_by_no_leaf
$group_column