Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
Odoo

Onchange Methods in Odoo

Update form fields dynamically in the UI with @api.onchange.

Onchange Methods in Odoo — a practical guide to Odoo onchange with clear examples you can reuse in real projects.

Odoo Tutorial Series (58/112). Prefer one article? Read the complete Odoo tutorial.

Short description

Onchange is UI-oriented; do not rely on it for server-side security.

onchange

@api.onchange('partner_id')
def _onchange_partner_id(self):
    if self.partner_id:
        self.email = self.partner_id.email

Leave a reply

Your email address will not be published. Required fields are marked *