diff options
| author | Xavier Morel <xmo@openerp.com> | 2012-08-06 10:08:46 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2012-08-06 10:08:46 +0200 |
| commit | 44b662b5bb799f46ee9ce948de26b6e06cea8e6e (patch) | |
| tree | cd8078135425ac32e7caf2587ed24bc38daa15ca /addons/web/static | |
| parent | ff801ce499f680bbba8e61f2a28c9d6733af0353 (diff) | |
[IMP] merge group count into group title in grouped list, as requested by al
bzr revid: xmo@openerp.com-20120806080846-w4r7t84gbpf9o47o
Diffstat (limited to 'addons/web/static')
| -rw-r--r-- | addons/web/static/src/js/view_list.js | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index e1367fb792a..57be3ca6db1 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -444,10 +444,6 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi id: '_group', tag: '', string: _t("Group"), meta: true, modifiers_for: function () { return {}; }, modifiers: {} - }, { - id: '_count', tag: '', string: '#', meta: true, - modifiers_for: function () { return {}; }, - modifiers: {} }); } @@ -1342,15 +1338,19 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we _t("Grouping on field '%s' is not possible because that field does not appear in the list view."), group.grouped_on)); } + var group_label; try { - $group_column.html(instance.web.format_cell( + group_label = instance.web.format_cell( row_data, group_column, { value_if_empty: _t("Undefined"), process_modifiers: false - })); + }); } catch (e) { - $group_column.html(row_data[group_column.id].value); + group_label = row_data[group_column.id].value; } + $group_column.text(_.str.sprintf("%s (%d)", + group_label, group.length)); + if (group.length && group.openable) { // Make openable if not terminal group & group_by_no_leaf $group_column.prepend('<span class="ui-icon ui-icon-triangle-1-e" style="float: left;">'); @@ -1362,8 +1362,6 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we } } self.indent($group_column, group.level); - // count column - $('<td>').text(group.length).appendTo($row); if (self.options.selectable) { $row.append('<td>'); |
