diff options
| author | RGA(OpenERP) <> | 2012-10-16 17:12:59 +0530 |
|---|---|---|
| committer | RGA(OpenERP) <> | 2012-10-16 17:12:59 +0530 |
| commit | 7368b52a95524897be9bc511035ad5a6ba28c3e4 (patch) | |
| tree | 97fc2402b07364746f6d3da9c926b209bb9a811f /addons/google_docs/static | |
| parent | 9932152fae4904e994c74a47f149615b3ca39104 (diff) | |
[IMP] counter should be apply on multiple section with same name attribute
bzr revid: rgaopenerp-20121016114259-9g496xqj8ldal1vk
Diffstat (limited to 'addons/google_docs/static')
| -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() { |
