diff options
Diffstat (limited to 'addons/google_docs/static/src')
| -rw-r--r-- | addons/google_docs/static/src/js/gdocs.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/addons/google_docs/static/src/js/gdocs.js b/addons/google_docs/static/src/js/gdocs.js index f293447f2ea..a0cc7353f3e 100644 --- a/addons/google_docs/static/src/js/gdocs.js +++ b/addons/google_docs/static/src/js/gdocs.js @@ -1,13 +1,18 @@ openerp.google_docs = function(instance, m) { var QWeb = instance.web.qweb, _t = instance.web._t; - +//{} instance.web.Sidebar = instance.web.Sidebar.extend({ on_attachments_loaded: function(attachments) { var self = this; _.chain(attachments) - .filter(function(attachment){ if (attachment.name ==='Google Doc') return true}) - .map(function(attachment, i){ attachment.name = _.str.sprintf(_t("%s (%s)"), attachment.name, i+1)}) + .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); }, redraw: function() { |
