Odoo Help


Domain Filtering issue

Erhuvwu Akpobaro
on 3/23/15, 8:53 AM 729 views

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 = {



'service_split': 0.35



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 ?

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 3/23/15, 8:53 AM
Seen: 729 times
Last updated: 3/27/15, 6:44 PM