This skill is errata for common pitfalls and differences in Odoo 19, not a tutorial.
Odoo 19 XML Views:
<list> NOT <tree> for list viewstarget="main" NOT target="inline" for settings actions<search> views: no expand attribute on <group><app> tag in settings: use name="module_name" NOT data-keystring attribute as XPath selector in view inheritanceGroups that do NOT exist in Community Edition:
base.group_multi_currencyaccount.group_account_basicaccount.group_account_managergroups attributePython / ORM:
models.NewId does NOT exist in Odoo 19 – use isinstance(record.id, int)target="inline" is NOT valid for – use ir.actions.act_window.targettarget="main"button_immediate_install cannot be called from post_init_hookres.config.settings, value 0 may not save – use Boolean checkbox + conditional field@api.model_create_multi returns list – unwrap for single createsread() method: fields go in kwargs {"fields": [...]}, not positional args(0, 0, vals) command, not separatelyCode style:
_ext suffix (e.g., sale_order_line.py not sale_order_line_ext.py)default_data.xml with noupdate="1"Testing:
make test must pass (all unit tests) after every changemake reset must work (clean install) after every changemake smoke must pass (E2E flow) after every changemake quality must pass (code linting) after every changet-if, t-else, t-foreach, t-esc, t-field, t-raw) in XML view definitions (form, list, search). These directives are only allowed in QWeb report templates (PDF invoices, delivery slips).| File | t-if / t-field | invisible / field |
|---|---|---|
views/*.xml (form, list, search) | ❌ FORBIDDEN | ✅ USE THIS |
views/report_*.xml (QWeb templates) | ✅ ALLOWED | ❌ WON'T WORK |
import logging
_logger = logging.getLogger(__name__)
# Log messages
_logger.info('Info message')
_logger.warning('Warning message')
_logger.error('Error message')
# Debug with pdb
import pdb; pdb.set_trace()