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

@api.model in Odoo

Mark methods that operate on the model/class rather than a recordset of ids.

@api.model in Odoo — a practical guide to Odoo @api.model with clear examples you can reuse in real projects.

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

Short description

Typical for helpers called without browsing specific records.

@api.model

@api.model
def default_get(self, fields_list):
    res = super().default_get(fields_list)
    res['state'] = 'draft'
    return res

Leave a reply

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