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.")) diff --git a/addons/google_docs/res_config_user_view.xml b/addons/google_docs/res_config_user_view.xml index 8e75577999d..9a0a07dc590 100644 --- a/addons/google_docs/res_config_user_view.xml +++ b/addons/google_docs/res_config_user_view.xml @@ -27,10 +27,10 @@

- To Create a new filter, go to the list of documents you want to attach a google document to and - save the filter. Then come back to this view. The saved filter will be available in the field above. - For instance, to attach a document to the sales orders of Agrolait, go to sale orders list view, - filter on Agrolait and save the filter. + To create a new filter:
+ - Go to your "Related Document Model" page and set the filter parameters in the "Search" view (Example of filter based on Leads/Opportunities: Sales Team Contains Sales Department)
+ - In this same "Search" view, select the menu "Save Current Filter", enter the name (Ex: Sales Department) and add the option "Share with all users" +The filter must therefore be available in this page.