diff --git a/addons/google_docs/google_docs.py b/addons/google_docs/google_docs.py
index 63b78cf1f75..824a9ddf06b 100644
--- a/addons/google_docs/google_docs.py
+++ b/addons/google_docs/google_docs.py
@@ -132,8 +132,11 @@ class google_docs_ir_attachment(osv.osv):
# check if a model is configured with a template
config_ids = pool_gdoc_config.search(cr, uid, [('model_id', '=', res_model)], context=context)
configs = []
- for config in pool_gdoc_config.browse(cr, uid, config_ids, context=context):
+ for config in pool_gdoc_config.browse(cr, SUPERUSER_ID, config_ids, context=context):
if config.filter_id:
+ if (config.filter_id.user_id and config.filter_id.user_id.id != uid):
+ #Private
+ continue
google_doc_configs = self._filter(cr, uid, config, config.filter_id, res_id, context=context)
if google_doc_configs:
configs.append({'id': config.id, 'name': config.name})
@@ -158,7 +161,7 @@ class google_docs_ir_attachment(osv.osv):
pool_gdoc_config = self.pool.get('google.docs.config')
pool_model = self.pool.get("ir.model")
attachment = {'url': False}
- config = pool_gdoc_config.browse(cr, uid, config_id, context=context)
+ config = pool_gdoc_config.browse(cr, SUPERUSER_ID, config_id, context=context)
if config:
res_model = config.model_id
model_ids = pool_model.search(cr, uid, [('model','=',res_model)])
@@ -220,11 +223,11 @@ class config(osv.osv):
}
def onchange_model_id(self, cr, uid, ids, model_id, context=None):
- res = {}
+ res = {'domain':{'filter_id':[]}}
if model_id:
- res['domain'] = {'filter_id': [('model_id', '=', model_id), ('user_id','=',False)]}
+ res['domain'] = {'filter_id': [('model_id', '=', model_id)]}
else:
- res['value'] = {'filter_id': [('user_id','=',False)]}
+ res['value'] = {'filter_id': False}
return res
_defaults = {
diff --git a/addons/google_docs/res_config_user_view.xml b/addons/google_docs/res_config_user_view.xml
index 9a0a07dc590..8125a46ae7e 100644
--- a/addons/google_docs/res_config_user_view.xml
+++ b/addons/google_docs/res_config_user_view.xml
@@ -25,12 +25,11 @@
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.
+ - Go to the OpenERP document you want to filter. For instance, go to Opportunities and search on Sales Department.
+ - In this same "Search" view, select the menu "Save Current Filter", enter the name (Ex: Sales Department)
Click to add a new template.
- Link your google drive template to any record of OpenERP. - If you have really specific documents you want your collaborator fill in, - e.g. - Using a spreadsheet to control the quality of your product, reviewing the delivery checklist for each delivery order in a foreign country in a document... - Its very easy to manage them by adding a Google Drive template in OpenERP to link your specific document to any records. + Link your own google drive templates to any record of OpenERP. If you have really specific documents you want your collaborator fill in, e.g. Use a spreadsheet to control the quality of your product or review the delivery checklist for each order in a foreign country, ... Its very easy to manage them, link them to OpenERP and use them to collaborate with your employees.
@@ -84,17 +79,6 @@ The filter must therefore be available in this page. -