Odoo Help

2

How to define on change method [Closed]

By
Susi
on 12/20/14, 8:21 AM 811 views

The Question has been closed

by
Susi
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

2

@susi

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

@api.onchange("code_district")
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>>
    <<then>>
    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.

Register

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)

Stats

Asked: 12/20/14, 8:21 AM
Seen: 811 times
Last updated: 1/21/16, 11:18 PM