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, 10 insertions, 1 deletions
diff --git a/addons/google_docs/static/src/js/gdocs.js b/addons/google_docs/static/src/js/gdocs.js index 0e5583fa953..ac19e4cc6e7 100644 --- a/addons/google_docs/static/src/js/gdocs.js +++ b/addons/google_docs/static/src/js/gdocs.js @@ -3,12 +3,20 @@ 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); self.$el.find('.oe_sidebar_add_attachment').after(QWeb.render('Google_doc', {widget: self})) self.$el.find('.oe_sidebar_add_google_doc').on('click', function (e) { - self.on_google_doc(); + self.on_google_doc(); }); }, on_google_doc: function() { @@ -27,6 +35,7 @@ var QWeb = instance.web.qweb, modal: true, }); } + }).done(function(){ form.reload(); }); }); |
