Odoo Help

1

1
1 答案
2
Petar Najman 塞尔维亚
2014/1/12 下午7:25

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 注释
Khalid Masood 南非
2014/1/14 下午4:10

Thank you for the help. Much appreciated.

Petar Najman 塞尔维亚
2014/1/16 上午11:19

You are very welcome Khalid :)

提问
Keep Informed
1 关注者(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