I have a many2one field which i want to have a dynamic domain filter on :
but i want start with something basic by just passing a variable through a integer in a function:
class mm_control_zone(osv.osv):
_name = "mm.control.zone"
_rec_name = "zone_id"
_columns = {
'zone_id':fields.many2one('product.category' , 'Zone')
}
def get_domain_useer_id(self,cr,uid,ids,context=None):
lids = 20
return domain = {'product_category':[('id', '=', lids)]}
xml:
<field name="zone_id" on_change="get_domain_useer_id()"/>
So far the function doesn't work as my field is not being filtered.
is there a better way of having a dynamic filter ?