diff options
| author | Denis Ledoux <dle@openerp.com> | 2013-06-27 18:07:15 +0200 |
|---|---|---|
| committer | Denis Ledoux <dle@openerp.com> | 2013-06-27 18:07:15 +0200 |
| commit | 53358465b32fb99295bf75a2a7ffd3f1d8157af6 (patch) | |
| tree | 4f71820b155eecb922523593bbe4ced65b32bc02 /addons/google_docs/static/src/js/gdocs.js | |
| parent | 4cf5533d935e9ac4539420eec2295e1ea3cfaeed (diff) | |
| parent | bf1163c99a842f35ba96245b300eba42c1f6f7e6 (diff) | |
[REF]google_docs to google_drive, using oauth authentication
bzr revid: dle@openerp.com-20130627160715-ok7q82cyivirzri1
Diffstat (limited to 'addons/google_docs/static/src/js/gdocs.js')
| -rw-r--r-- | addons/google_docs/static/src/js/gdocs.js | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/addons/google_docs/static/src/js/gdocs.js b/addons/google_docs/static/src/js/gdocs.js deleted file mode 100644 index 1cc511ef4d9..00000000000 --- a/addons/google_docs/static/src/js/gdocs.js +++ /dev/null @@ -1,40 +0,0 @@ -openerp.google_docs = function(instance, m) { -var _t = instance.web._t, - QWeb = instance.web.qweb; - - instance.web.Sidebar.include({ - redraw: function() { - var self = this; - this._super.apply(this, arguments); - 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(); - }); - }, - on_google_doc: function() { - var self = this; - var view = self.getParent(); - var ids = ( view.fields_view.type != "form" )? view.groups.get_selection().ids : [ view.datarecord.id ]; - if( !_.isEmpty(ids) ){ - view.sidebar_eval_context().done(function (context) { - var ds = new instance.web.DataSet(this, 'ir.attachment', context); - ds.call('google_doc_get', [view.dataset.model, ids, context]).done(function(r) { - if (r == 'False') { - var params = { - error: response, - message: _t("The user google credentials are not set yet. Contact your administrator for help.") - } - $(openerp.web.qweb.render("DialogWarning", params)).dialog({ - title: _t("User Google credentials are not yet set."), - modal: true, - }); - } - }).done(function(r){ - window.open(r.url,"_blank"); - view.reload(); - }); - }); - } - } - }); -}; |
