diff --git a/addons/base/static/src/css/base.css b/addons/base/static/src/css/base.css index 9b3ac6ef47c..88dba9bdb1a 100644 --- a/addons/base/static/src/css/base.css +++ b/addons/base/static/src/css/base.css @@ -534,12 +534,12 @@ body.openerp { -moz-border-radius-topright: 7px; border-top-right-radius: 7px; } -.openerp .oe-listview table tbody tr:last-child th:first-child { +.openerp .oe-listview table tbody:last-child tr:last-child th:first-child { -webkit-border-bottom-left-radius: 7px; -moz-border-radius-bottomleft: 7px; border-bottom-left-radius: 7px; } -.openerp .oe-listview table tbody tr:last-child td:last-child { +.openerp .oe-listview table tbody:last-child tr:last-child td:last-child { -webkit-border-bottom-right-radius: 7px; -moz-border-radius-bottomright: 7px; border-bottom-right-radius: 7px; diff --git a/addons/base/static/src/js/list.js b/addons/base/static/src/js/list.js index bc92c4669a3..85798d2aea3 100644 --- a/addons/base/static/src/js/list.js +++ b/addons/base/static/src/js/list.js @@ -469,33 +469,38 @@ openerp.base.ListView.Groups = Class.extend( /** @lends openerp.base.ListView.Gr make_fragment: function () { return this.$element[0].ownerDocument.createDocumentFragment(); }, + open_group: function (e, group) { + var self = this, + $row = $(e.currentTarget); + group.list(function (groups) { + $row.parent()[0].insertBefore( + self.render_groups(groups), + $row[0].nextSibling); + }, function (dataset) { + // Now we need to split the current tbody in order to + // insert the list's + + // Create new tbody after current one + var $current_body = $row.closest('tbody'); + + var $next_siblings = $row.nextAll(); + if ($next_siblings.length) { + var $split = $('
').insertAfter($current_body); + // Move all following siblings of current row to split + $split.append($row.nextAll()); + } + // Insert list rendering after current tbody + self.render_dataset(dataset).then(function (list) { + $current_body.after(list.$current); + }); + }); + }, render_groups: function (datagroups) { var self = this; var placeholder = this.make_fragment(); _(datagroups).each(function (group) { - var $row = $('