Home › Curriculum › Odoo Developer › OWL and the web client
Views, actions, reports and OWL · 16 min · OWL 2 / 17–20OWL and the web client
Components, templates, hooks and services; registering field widgets; patching existing components; when JavaScript is the right tool.
In this lesson
- Components, templates and hooks
- Registries, services and patching
- When to use JavaScript
Key points
- class extends Component; static template/props; setup() with hooks
- useState, onWillStart, onMounted, useRef, useService('orm' | 'action' | 'notification')
- registry.category('fields'|'actions'|'systray').add(...); patch()
- UI in JS; business rules in Python
Real-world example
A team enforced a discount limit in a JavaScript patch on the order form. Imported orders and the website ignored it. Moving the rule into Python (action_confirm and a constraint) enforced it everywhere; the JS was reduced to a friendly warning.
Questions and answers
Which bundle should a back-end widget be added to?
web.assets_backend.
What does patch() let you do?
Modify an existing class's methods (for example a core component) without copying it.