summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto López López (OpenERP) <rlo@openerp.com>2012-02-29 09:38:33 +0100
committerRoberto López López (OpenERP) <rlo@openerp.com>2012-02-29 09:38:33 +0100
commitf8213e68f0a1d5ffde27a47b70211a0cb205db9a (patch)
tree5cdb0a54b896504e062c5d1f86361e1afae4ae58
parent841f8b12b413dd7a0d4091182d092128f27da5f3 (diff)
[imp] integration with google_base_account
bzr revid: rlo@openerp.com-20120229083833-yd0wfg8x5ywc9e1c
-rw-r--r--addons/google_docs/google_docs.py9
-rw-r--r--addons/google_docs/static/src/js/gdocs.js1
2 files changed, 8 insertions, 2 deletions
diff --git a/addons/google_docs/google_docs.py b/addons/google_docs/google_docs.py
index 1dd632aab83..1c36533e614 100644
--- a/addons/google_docs/google_docs.py
+++ b/addons/google_docs/google_docs.py
@@ -23,7 +23,7 @@ GOOGLE DOCS
#########################################
'''
- edit_url_template = 'https://docs.google.com/Edit?docid=%s'
+ edit_url_template = 'https://docs.google.com/document/d/%s/edit'
prefix_gdoc_id_res = DOCUMENT_LABEL + ':'
def copy_gdoc(self, cr, uid, model, context=None):
@@ -61,6 +61,9 @@ google_docs.copy_gdoc()
# check google_base_account
users_obj = self.pool.get('res.users')
user = users_obj.browse(cr, uid, [uid])[0]
+ print '%s' % user.__dict__
+ print '%s' % user.gmail_user
+ print '%s' % user.gmail_password
if not user.gmail_user or not user.gmail_password:
return -2
@@ -81,7 +84,9 @@ google_docs.copy_gdoc()
client.ClientLogin(user.gmail_user, user.gmail_password, client.source, service='writely')
resource = gdata.docs.data.Resource(gdata.docs.data.DOCUMENT_LABEL)
new_resource = client.post(entry=resource, uri='https://docs.google.com/feeds/default/private/full/')
-
+ print new_resource.__dict__
+ print new_resource.resource_id.text
+ print new_resource.resource_id
return self.edit_url_template % (new_resource.resource_id.text,)
'''
diff --git a/addons/google_docs/static/src/js/gdocs.js b/addons/google_docs/static/src/js/gdocs.js
index 32a57e18c0c..6e0ae93fdf3 100644
--- a/addons/google_docs/static/src/js/gdocs.js
+++ b/addons/google_docs/static/src/js/gdocs.js
@@ -10,6 +10,7 @@ instance.web.form.SidebarAttachments = instance.web.form.SidebarAttachments.exte
var $gdocbtn = this.$element.find('.oe_google_docs_button');
$gdocbtn.attr('disabled', 'true').find('img, span').toggle();
new openerp.sessions.session0.web.DataSet(this, 'google.docs').call_button('copy_gdoc', [[this.view.datarecord.id], this.view.dataset.get_context()], function(r) {
+ console.log(r);
$gdocbtn.hide();
self.do_update();
self.do_action(r.result);