diff options
| author | Somesh Khare <skh@openerp.com> | 2014-08-26 11:55:23 +0530 |
|---|---|---|
| committer | Martin Trigaux <mat@openerp.com> | 2014-09-04 14:47:06 +0200 |
| commit | cce70fd4c9e281245fceff5d9275770dfa30d29a (patch) | |
| tree | 4ff77e9d5792c7c54fa7db7783c5ec9cd254c480 /addons/document/static/src/js/document.js | |
| parent | 5872c2485d8351b6e0569009b4828448fed69622 (diff) | |
[FIX] document: display Attachment(s) menu only on form view
The attachment menu (list and add) has no effect in tree view (not supporting multi-items upload and display), the menu should then only be displayed in these view (opw 612534)
Diffstat (limited to 'addons/document/static/src/js/document.js')
| -rw-r--r-- | addons/document/static/src/js/document.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/document/static/src/js/document.js b/addons/document/static/src/js/document.js index e4bce2da76e..5b353d5b0dd 100644 --- a/addons/document/static/src/js/document.js +++ b/addons/document/static/src/js/document.js @@ -3,8 +3,10 @@ openerp.document = function (instance) { instance.web.Sidebar.include({ init : function(){ this._super.apply(this, arguments); - this.sections.splice(1, 0, { 'name' : 'files', 'label' : _t('Attachment(s)'), }); - this.items['files'] = []; + if (this.getParent().view_type == "form"){ + this.sections.splice(1, 0, { 'name' : 'files', 'label' : _t('Attachment(s)'), }); + this.items['files'] = []; + } }, on_attachments_loaded: function(attachments) { //to display number in name if more then one attachment which has same name. |
