<commit_before>openerp.google_docs = function(instance, m) {
var QWeb = instance.web.qweb,
    _t = instance.web._t;

    instance.web.Sidebar = instance.web.Sidebar.extend({
       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();
            });
        },
        on_google_doc: function() {<commit_msg>[IMP] add counter on google doc when more than one document attached<commit_after>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)})
            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();
            });
        },
        on_google_doc: function() {
{'fraction_non_alphanumeric': 0.14511041009463724, 'fraction_numerical': 0.0006309148264984228, 'mean_word_length': 2.5088495575221237, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '356254', 'n_tokens_mistral': 474, 'n_tokens_neox': 466, 'n_words': 84}