Odoo Help


How to define on change method [Closed]

on 12/20/14, 8:21 AM 845 views

The Question has been closed

on 01/21/2016 23:18:12

I have 2 fields , code district and sub-district name . I want when the code is selected then the name of the subdistrict appear (output) .please help me with code



If you are saying that you have stored the value of "subdistrict" and based on the value of "code_district" then in Odoo you can write the following on_change method

def onchange_distict(self):
    <<your code to fetch the sub district based on code_district>>
    <<you can get the value of code_district as self.code_district>>
    self.sub_district = <<fetched value>>

hope this helps !!

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: 12/20/14, 8:21 AM
Seen: 845 times
Last updated: 1/21/16, 11:18 PM