[IMP] If any attachment on a record, display 'X Attachment(s)' in sidebar

bzr revid: fme@openerp.com-20120828144613-6a47a4o5iwqb8t0o
This commit is contained in:
Fabien Meghazi 2012-08-28 16:46:13 +02:00
parent 67ea7a40a4
commit 03383c7408
2 changed files with 2 additions and 1 deletions

View File

@ -874,7 +874,7 @@ instance.web.Sidebar = instance.web.Widget.extend({
var view = this.getParent();
this.sections = [
{ 'name' : 'print', 'label' : _t('Print'), },
{ 'name' : 'files', 'label' : _t('Attachment'), },
{ 'name' : 'files', 'label' : _t('Attachment(s)'), },
{ 'name' : 'other', 'label' : _t('More'), }
];
this.items = {

View File

@ -540,6 +540,7 @@
<t t-foreach="widget.sections" t-as="section">
<div class="oe_form_dropdown_section">
<button class="oe_dropdown_toggle oe_dropdown_arrow">
<t t-if="section.name == 'files'" t-raw="widget.items[section.name].length || ''"/>
<t t-esc="section.label"/>
</button>
<ul class="oe_dropdown_menu">