This question has been flagged
2 Replies
3179 Views

Which function works when the field changed,

<field name="is_company" on_change="onchange_type(is_company)" class="oe_inline"/> <label for="is_company" string="Is a Company?"/>)

I search for onchange_type(is_company),,but i cant find it?

 

Avatar
Discard
Best Answer

search for onchange_type in the .py file. You can find it in base > res > res_partner.py, res_users.py.

Avatar
Discard
Author

Hm...kitiyarnu

Best Answer

 for with Hi Aisha,

search for 'onchange_type' and you will get the function defintions and you can find the function you are looking for with the help of object to which that function belongs to.

For Example I am just printing one function:

    def onchange_type(self, cr, uid, ids, is_company, context=None):
        value = {}
        value['title'] = False
        if is_company:
            value['use_parent_address'] = False
            domain = {'title': [('domain', '=', 'partner')]}
        else:
            domain = {'title': [('domain', '=', 'contact')]}
        return {'value': value, 'domain': domain}

 

Hope this helps,, let me know if any querys

Avatar
Discard
Author

what is "title" & "use_parent_address" means

those are field names