summaryrefslogtreecommitdiff
path: root/addons/google_docs
diff options
context:
space:
mode:
authorMVA <mva@openerp.com>2012-03-28 12:10:15 +0200
committerMVA <mva@openerp.com>2012-03-28 12:10:15 +0200
commit774aa481c2f60df74d8b01f03b00cad002d8e105 (patch)
tree99bae5b9b227bc33dcc5c56d84816236812422b1 /addons/google_docs
parent3ec3ced2a61c617ccac91869309cae02964489f0 (diff)
[IMP] correct the copy with the good document title
bzr revid: mva@openerp.com-20120328101015-4v1fit8z3cno9y91
Diffstat (limited to 'addons/google_docs')
-rw-r--r--addons/google_docs/google_docs.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/google_docs/google_docs.py b/addons/google_docs/google_docs.py
index 13d9634dcf8..1e6071cd716 100644
--- a/addons/google_docs/google_docs.py
+++ b/addons/google_docs/google_docs.py
@@ -78,16 +78,17 @@ class google_docs_ir_attachment(osv.osv):
def copy_gdoc(self, cr, uid, model, google_res_id, ids,context=None):
client = self._auth(cr, uid)
# fetch and copy the original document
+ print 'test'
original_resource = client.get_resource_by_id(google_res_id)
- #copy the document you choose in the configuration
- copy_resource = client.copy_resource(original_resource,'copy_foo')
+ #copy the document you choose in the configuration
+ copy_resource = client.copy_resource(original_resource,'copy_%s' % original_resource.title.text)
# register into the db
self.create(cr, uid, {
'res_model': model,
'res_id': ids[0],
'type': 'url',
- 'name': 'copy_%s' % gdocs_resource.title.text,
+ 'name': 'copy_%s' % original_resource.title.text,
'url': copy_resource.get_alternate_link().href
},context=context)