Odoo 19 Development Expert
This skill provides specialized knowledge and workflows for developing, debugging, and maintaining Odoo 19 applications using Docker-based environments.
Core Principles
- •Strict Odoo 19 Compliance: Always use the latest ORM API (
api.model,api.depends) and Owl 2 components. Avoid deprecated features. - •OCA Standards: Adhere to the Odoo Community Association guidelines for naming, structure, and security.
- •Docker-First Workflow: Assume development happens in a Docker container (via
docker-compose). - •Security First: Always define
ir.model.access.csvand necessary Record Rules. Useapi.constrainsfor data integrity.
Reference Guides
This skill includes specialized guides. Read them based on the task:
- •Backend Development: See references/backend_guide.md for ORM, Models, and PostgreSQL interactions.
- •Frontend Development: See references/frontend_guide.md for Owl components, Hooks, and XML views.
- •Coding Standards: See references/oca_standards.md for module structure, naming conventions, and linting rules.
- •Docker & Debugging: See references/docker_guide.md for environment management and debugging workflows.
Common Workflows
Creating a New Module
- •Scaffold: Use the official command:
docker-compose -f <compose_file> exec -it odoo odoo scaffold my_module /mnt/extra-addons. (Usedocker-compose.dev.phuoctv.ymlif it exists, otherwise fallback to.dev.ymlor.yml) - •Manifest: Defines dependencies and assets (generated automatically).
- •Models: Create
models/(Python files) andir.model.access.csvinsecurity/. - •Views: Create
views/(XML files) for menus, forms, trees, and search views. - •Install: Update the module list and install via UI or command line.
Debugging
- •Python: Use
import pdb; pdb.set_trace()inside the method. Attach to the container (see Docker guide). - •Frontend: Use browser DevTools and the "Owl" tab (if available).
- •Logs: Check
docker-compose -f docker-compose.dev.phuoctv.yml logs -f odoofor server-side errors.
Advanced Shell & Testing
- •Odoo Shell: Use
scripts/odoo_shell.shto interact with the database via Python. - •Run Tests: Use
scripts/run_tests.sh <module_name>to execute the module suite.
Prompting Tips
- •When asking for code, specify if it's for a Model, Controller, or Component.
- •Ask to "Scaffold a module X" to get the full directory structure.