diff options
Diffstat (limited to 'addons/google_docs/static/src/js/gdocs.js')
| -rw-r--r-- | addons/google_docs/static/src/js/gdocs.js | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/addons/google_docs/static/src/js/gdocs.js b/addons/google_docs/static/src/js/gdocs.js index a7d9074e2c8..1cdb22aeb41 100644 --- a/addons/google_docs/static/src/js/gdocs.js +++ b/addons/google_docs/static/src/js/gdocs.js @@ -2,23 +2,11 @@ openerp.google_docs = function(instance, m) { var _t = instance.web._t, QWeb = instance.web.qweb; - instance.web.Sidebar = instance.web.Sidebar.extend({ - on_attachments_loaded: function(attachments) { - 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); - }, + instance.web.Sidebar.include({ redraw: function() { var self = this; this._super.apply(this, arguments); - self.$el.find('.oe_sidebar_add_attachment').after(QWeb.render('Google_doc', {widget: self})) + self.$el.find('.oe_sidebar_add_attachment').after(QWeb.render('AddGoogleDocumentItem', {widget: self})) self.$el.find('.oe_sidebar_add_google_doc').on('click', function (e) { self.on_google_doc(); }); |
