[IMP]Putting a domain of filter to see only filters of the choosen model.
bzr revid: dhr@tinyerp.com-20130304052058-fzs7a6ct9d1xb5so
This commit is contained in:
parent
d9966b45d8
commit
62fc309e0c
|
@ -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),
|
'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 = {
|
_defaults = {
|
||||||
'name_template': 'gdoc_%(name)s',
|
'name_template': 'gdoc_%(name)s',
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Google Drive Configuration" version="7.0">
|
<form string="Google Drive Configuration" version="7.0">
|
||||||
<group>
|
<group>
|
||||||
<field name="model_id"/>
|
<field name="model_id" on_change="onchange_model_id(model_id)"/>
|
||||||
<label for='filter_id'/>
|
<label for='filter_id'/>
|
||||||
<div>
|
<div>
|
||||||
<field name='filter_id'/>
|
<field name='filter_id'/>
|
||||||
|
|
Loading…
Reference in New Issue