Hello ,
class mm_control(osv.osv):
_name = "mm.control"
_rec_name = "company"
_columns = {
'company':fields.many2one('res.company' , 'Company', domain="[('company_type', '=', 'Property Company')]", required=True, select=1 ) ,
'rental_split': fields.float('Rent', help="Service charge split of total rent amount"),
'maintenance_split': fields.float('Maintenance', help="Rent split of total rent amount"),
'service_split': fields.float('Service', help="Service charge split of total rent amount"),
'parent_zone_id':fields.many2one('product.category','Parent Zone', domain="[('id', 'child_of' , 3)]" , required=True , help="Parent zone for company "),
'mm_control_zone_id': fields.one2many('mm.control.zone' ,'zone_id','Zones' , domain="[('zone_id', '=' , 3)]")
}
_defaults = {
'rental_split':0.25,
'maintenance_split':0.40,
'service_split': 0.35
}
mm_control()
class mm_control_zone(osv.osv):
_name = "mm.control.zone"
_rec_name = "zone_id"
_columns = {
'zone_id':fields.many2one('product.category' , 'Zone')
}
I need help with domain filtering on a one2many field :
1. I have two tables MM_Control , MM_Control_Zone
2.My code below shows two fields of interest parent_zone_id and mm_control_zone_id , mm_control_zone_id is linked to the table mm_control_zone through the field zone id
3. What i what to achieve is domain filter where the data displayed on mm_control_zone_id is filtered based on being a child of whatever I select on parent_zone_id.
Here are the key problems :
1. when i create a new list of zones in my mm_control_zone table , when i go to my MM_control table and select the option I want I do not see the created list I just see everything from the original drop down .
Any ideas as to how i go about doing this ?