[FIX] restore attachement, part2 very beginning of add
authorAntony Lesuisse <al@openerp.com>
Tue, 17 Apr 2012 01:43:23 +0000 (03:43 +0200)
committerAntony Lesuisse <al@openerp.com>
Tue, 17 Apr 2012 01:43:23 +0000 (03:43 +0200)
bzr revid: al@openerp.com-20120417014323-vp1cn1k5en5ogmdq

addons/web/static/src/js/views.js
addons/web/static/src/xml/base.xml

index 5098237..79d3d4c 100644 (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;
index 0df4ca7..7cbffe8 100644 (file)
                             <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>