summaryrefslogtreecommitdiff
path: root/addons/google_docs/google_docs.py
diff options
context:
space:
mode:
authorRajesh Prajapati (OpenERP) <rpr@tinyerp.com>2013-04-03 14:34:04 +0530
committerRajesh Prajapati (OpenERP) <rpr@tinyerp.com>2013-04-03 14:34:04 +0530
commitcc69f7e2e2de7f33a4848a9ef1c3a58dad18437e (patch)
tree10d1b6d762ee3a7051773f67c5f05e267a0dea51 /addons/google_docs/google_docs.py
parentd241e853ca60cdfe3758113cd6019eab541c4955 (diff)
[IMP] google_docs : changes for tooltip and name_template
bzr revid: rpr@tinyerp.com-20130403090404-skf3m78u0ervtg6y
Diffstat (limited to 'addons/google_docs/google_docs.py')
-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 999e4b29a29..5a72febee8e 100644
--- a/addons/google_docs/google_docs.py
+++ b/addons/google_docs/google_docs.py
@@ -164,12 +164,13 @@ class google_docs_ir_attachment(osv.osv):
model_ids = pool_model.search(cr, uid, [('model','=',res_model)])
if not model_ids:
return attachment
- model = pool_model.browse(cr, uid, model_ids[0], context=context)
- record = self.pool.get(res_model).browse(cr, uid, res_id, context=context)
+ model = pool_model.browse(cr, uid, model_ids[0], context=context).name
filter_name = config.filter_id and config.filter_id.name or False
+ record = self.pool.get(res_model).read(cr, uid, res_id, [], context=context)
+ record.update({'model': model,'filter':filter_name})
name_gdocs = config.name_template or "%(name)s_%(model)s_%(filter)s_gdrive"
try:
- name_gdocs = name_gdocs % {'name': record.name, 'model': model.name, 'filter': filter_name}
+ name_gdocs = name_gdocs % record
except:
raise osv.except_osv(_('Key Error!'), _("Your Google Doc Name Pattern's key does not found in object."))