[imp] integration with google_base_account
bzr revid: rlo@openerp.com-20120229083833-yd0wfg8x5ywc9e1c
This commit is contained in:
parent
841f8b12b4
commit
f8213e68f0
|
@ -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,)
|
||||
|
||||
'''
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue