[FIX] When you change the model, it will change the related domain for the filters

bzr revid: jco@openerp.com-20130221100208-1w6ypan5f3mrv0bm
This commit is contained in:
Josse Colpaert 2013-02-21 11:02:08 +01:00
parent c63d1f9100
commit 62404c7a72
2 changed files with 11 additions and 1 deletions

View File

@ -214,6 +214,16 @@ class base_action_rule(osv.osv):
self._register_hook(cr, ids)
return True
def onchange_model_id(self, cr, uid, ids, model_id, context=None):
if model_id:
model = self.pool.get('ir.model').browse(cr, uid, model_id, context=context)
data = {'model': model.model}
else:
data = {'model': False}
data.update({'filter_pre_id': False, 'filter_id': False})
return {'value': data}
def _check(self, cr, uid, automatic=False, use_new_cursor=False, context=None):
""" This Function is called by scheduler. """
context = context or {}

View File

@ -15,7 +15,7 @@
<h1><field name="name"/></h1>
<group>
<group>
<field name="model_id"/>
<field name="model_id" on_change="onchange_model_id(model_id)"/>
<field name="model" invisible="1"/>
</group>
<group>