From 774aa481c2f60df74d8b01f03b00cad002d8e105 Mon Sep 17 00:00:00 2001 From: MVA Date: Wed, 28 Mar 2012 12:10:15 +0200 Subject: [IMP] correct the copy with the good document title bzr revid: mva@openerp.com-20120328101015-4v1fit8z3cno9y91 --- addons/google_docs/google_docs.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'addons/google_docs/google_docs.py') 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) -- cgit v1.2.3