diff options
| author | Rajesh Prajapati (OpenERP) <rpr@tinyerp.com> | 2013-04-03 14:34:04 +0530 |
|---|---|---|
| committer | Rajesh Prajapati (OpenERP) <rpr@tinyerp.com> | 2013-04-03 14:34:04 +0530 |
| commit | cc69f7e2e2de7f33a4848a9ef1c3a58dad18437e (patch) | |
| tree | 10d1b6d762ee3a7051773f67c5f05e267a0dea51 /addons/google_docs | |
| parent | d241e853ca60cdfe3758113cd6019eab541c4955 (diff) | |
[IMP] google_docs : changes for tooltip and name_template
bzr revid: rpr@tinyerp.com-20130403090404-skf3m78u0ervtg6y
Diffstat (limited to 'addons/google_docs')
| -rw-r--r-- | addons/google_docs/google_docs.py | 7 | ||||
| -rw-r--r-- | addons/google_docs/res_config_user_view.xml | 8 |
2 files changed, 8 insertions, 7 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.")) 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 @@ <div> <field name='filter_id' context="{'default_user_id': False, 'default_model_id': model_id, 'hide_user_field': True}" domain="[('user_id','=',False)]"/> <p class="oe_grey"> - 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. + <b>To create a new filter:</b><br/> + - 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)<br/> + - 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. </p> </div> <field name='gdocs_template_url' placeholder="https://docs.google.com/document/d/1vOtpJK9scIQz6taD9tJRIETWbEw3fSiaQHArsJYcua4/edit" required="1"/> |
