This question is older, but I had the same problem and it turned out. This is most likely not the best solution, but it works. I assume that you know how to write a custom module, so just add a dependency to the "document" and create your own javascript (for example, static / src / js / document.js, do not forget to include it in your openerp .py) with the following contents :
openerp.document = function (instance) { _t = instance.web._t; instance.web.Sidebar.include({ init : function(){ this._super.apply(this, arguments); if (window.location.href.indexOf('&model=res.partner') === -1) this.sections.splice(1, 0, { 'name' : 'files', 'label' : _t('Attachment(s)'), }); this.items['files'] = []; }, }); };
In this example, the Attach button will be hidden in the res.partner form view.
Maybe someone else knows a better way to search for the current model compared to my solution for finding a string in window.location.href
chickahoona
source share