diff options
| author | Dharti Ratani (Open ERP) <dhr@tinyerp.com> | 2013-03-04 10:50:58 +0530 |
|---|---|---|
| committer | Dharti Ratani (Open ERP) <dhr@tinyerp.com> | 2013-03-04 10:50:58 +0530 |
| commit | 62fc309e0c6a91cf97956ff00bf423d930b81840 (patch) | |
| tree | f37d12d71d1e64586bebd3a60ae16a29aba6d6f8 /addons/google_docs/google_docs.py | |
| parent | d9966b45d88b6f4cb03c9565907265c92c78045a (diff) | |
[IMP]Putting a domain of filter to see only filters of the choosen model.
bzr revid: dhr@tinyerp.com-20130304052058-fzs7a6ct9d1xb5so
Diffstat (limited to 'addons/google_docs/google_docs.py')
| -rw-r--r-- | addons/google_docs/google_docs.py | 11 |
1 files changed, 11 insertions, 0 deletions
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', } |
