[FIX] restore attachement, part2 very beginning of add

bzr revid: al@openerp.com-20120417014323-vp1cn1k5en5ogmdq
This commit is contained in:
Antony Lesuisse
2012-04-17 03:43:23 +02:00
parent 2a54e468a9
commit 4ecd07837f
2 changed files with 9 additions and 3 deletions
+6 -3
View File
@@ -757,7 +757,6 @@ session.web.Sidebar = session.web.Widget.extend({
var section = $(this).data('section');
var index = $(this).data('index');
$(this).closest('ul').hide();
console.log('click item',section,index);
var item = self.items[section][index];
if (item.callback) {
item.callback.apply(self, [item]);
@@ -876,8 +875,12 @@ session.web.Sidebar = session.web.Widget.extend({
a.url = prefix + a.id + '&t=' + (new Date().getTime());
}
});
this.items['files'] = attachments;
this.redraw();
attachments.push( { label: _t("Add..."), callback: self.on_attachment_add } );
self.items['files'] = attachments;
self.redraw();
},
on_attachment_add: function(e) {
this.$element.find('.oe_sidebar_add').show();
},
on_attachment_changed: function(e) {
return;
+3
View File
@@ -519,6 +519,9 @@
<t t-raw="item.label"/>
</a>
</li>
<li t-if="section.name == 'files'" class="oe_sidebar_add" style="display:none;">
Input type file stuff
</li>
</ul>
</div>
</t>