Odoo Help

1

1
1 Answer
2
Petar Najman Serbia
1/12/14, 7:25 PM

Hi Khalid,

If you want to apply that kind of filtering you should use domains on fields instead of using related fields

class sna_aor_super(orm.Model): 
    _name = "sna.aor.super" 
    _description = "Area of Registration Super"
    _columns = { 
        'district_id' : fields.many2one('sna.district','District', select=True, required=True, ondelete="restrict"), 
        'sub_district_id' : fields.many2one('sna.sub.district', 'Sub District', domain="[('sub_district_id', '=', district_id)]", select=True, required=True),
        'area_id' : fields.many2one('sna.area', 'Area', domain="[('sub_district_id', '=', sub_district_id)]", select=True, required=True),
    }

Regards, Petar

2 Comments
Khalid Masood South Africa
1/14/14, 4:10 PM

Thank you for the help. Much appreciated.

Petar Najman Serbia
1/16/14, 11:19 AM

You are very welcome Khalid :)

Ask a Question
Keep Informed
1 follower(s)
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.

Register
Odoo Training Center

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

Test it now