diff options
| author | Tejas Tank <tta@openerp.com> | 2012-10-23 16:11:08 +0530 |
|---|---|---|
| committer | Tejas Tank <tta@openerp.com> | 2012-10-23 16:11:08 +0530 |
| commit | d62958e5abf517ee87c4b496c35ec66e280d5fcd (patch) | |
| tree | 2ae709f173e04e898983699998a69c344c0bb57a /addons/document/static/src | |
| parent | c55438e695d03854ebf1b82aa0d6b33b3dc278f0 (diff) | |
| parent | 0841cc1331ffd46f39cd9407ed852cc35ebad7cd (diff) | |
Google Doc Integration.
bzr revid: tta@openerp.com-20121023104108-rxjfb37ydv2108b8
Diffstat (limited to 'addons/document/static/src')
| -rw-r--r-- | addons/document/static/src/js/document.js | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/addons/document/static/src/js/document.js b/addons/document/static/src/js/document.js index 2dde2696c81..e4bce2da76e 100644 --- a/addons/document/static/src/js/document.js +++ b/addons/document/static/src/js/document.js @@ -5,6 +5,19 @@ openerp.document = function (instance) { this._super.apply(this, arguments); 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. + var self = this; + _.chain(attachments) + .groupBy(function(attachment) { return attachment.name}) + .each(function(attachment){ + if(attachment.length > 1) + _.map(attachment, function(attachment, i){ + attachment.name = _.str.sprintf(_t("%s (%s)"), attachment.name, i+1) + }) + }) + self._super(attachments); + }, }); -};
\ No newline at end of file +}; |
