diff --git a/addons/google_docs/google_docs.py b/addons/google_docs/google_docs.py index e507ce33b16..73f4bca3664 100644 --- a/addons/google_docs/google_docs.py +++ b/addons/google_docs/google_docs.py @@ -182,6 +182,17 @@ class config(osv.osv): 'name_template': fields.char('Google Drive Name Pattern', size=64, help='Choose how the new google drive will be named, on google side. Eg. gdoc_%(field_name)s', required=True), } + def onchange_model_id(self, cr, uid, ids, model_id): + res = {'domain':{'filter_id':[]}} + if model_id: + model_name = self.pool.get('ir.model').read(cr, uid, model_id, ['model']) + if model_name: + mod_name = model_name['model'] + res['domain'] = {'filter_id': [('model_id', '=', mod_name)]} + else: + res['value'] = {'filter_id': False} + return res + _defaults = { 'name_template': 'gdoc_%(name)s', } diff --git a/addons/google_docs/res_config_user_view.xml b/addons/google_docs/res_config_user_view.xml index de6f140bce4..40d4cd94093 100644 --- a/addons/google_docs/res_config_user_view.xml +++ b/addons/google_docs/res_config_user_view.xml @@ -21,7 +21,7 @@
- +