[FIX] don't display add/remove buttons in group_by_no_leaf views

bzr revid: xmo@openerp.com-20111214144317-7k0u4s2xg9ochpte
This commit is contained in:
Xavier Morel 2011-12-14 15:43:17 +01:00
parent efc5cabe7a
commit e557a4b4c0
2 changed files with 4 additions and 2 deletions

View File

@ -79,6 +79,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
self.compute_aggregates(); self.compute_aggregates();
}); });
this.no_leaf = false;
}, },
/** /**
* Retrieves the view's number of records per page (|| section) * Retrieves the view's number of records per page (|| section)
@ -473,6 +474,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
if (_.isEmpty(group_by) && !context['group_by_no_leaf']) { if (_.isEmpty(group_by) && !context['group_by_no_leaf']) {
group_by = null; group_by = null;
} }
this.no_leaf = !!context['group_by_no_leaf'];
this.reload_view(!!group_by, context).then( this.reload_view(!!group_by, context).then(
$.proxy(this, 'reload_content')); $.proxy(this, 'reload_content'));

View File

@ -573,7 +573,7 @@
<th t-att-colspan="columns_count"> <th t-att-colspan="columns_count">
<table> <table>
<tr> <tr>
<td t-if="options.action_buttons !== false" class="oe-actions"> <td t-if="!no_leaf and options.action_buttons !== false" class="oe-actions">
<button type="button" class="oe-list-add" <button type="button" class="oe-list-add"
t-if="options.addable"> t-if="options.addable">
<t t-esc="options.addable"/> <t t-esc="options.addable"/>
@ -634,7 +634,7 @@
this.prepend($title); this.prepend($title);
</t> </t>
</t> </t>
<th t-name="Listview.navigation.button" t-if="options.pager !== false" <th t-name="Listview.navigation.button" t-if="!no_leaf and options.pager !== false"
class="oe-list-pager" t-att-colspan="columns_count"> class="oe-list-pager" t-att-colspan="columns_count">
<button type="button" disabled="disabled" <button type="button" disabled="disabled"
data-pager-action="first">First</button> data-pager-action="first">First</button>