Odoo 도움말

1

1
1 응답
2
Petar Najman Serbia
14. 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 South Africa
14. 1. 14. 오후 4:10

Thank you for the help. Much appreciated.

Petar Najman Serbia
14. 1. 16. 오전 11:19

You are very welcome Khalid :)

질문하기
Keep Informed
1 팔로워
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