[IMP] add counter on google doc when more than one document attached

bzr revid: rgaopenerp-20121016073053-nd6s90drak6crs0a
This commit is contained in:
RGA(OpenERP) 2012-10-16 13:00:53 +05:30
parent c9f02f6dd9
commit 9932152fae
1 changed files with 7 additions and 0 deletions

View File

@ -3,6 +3,13 @@ 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)})
self._super(attachments);
},
redraw: function() {
var self = this;
this._super.apply(this, arguments);