Odoo reports use QWeb templates in report XML, bound to models like sale.order or stock.picking, rendered to PDF via wkhtmltopdf or report engines. Create ir.actions.report, define paperformat, build QWeb with t-field and t-call layouts, add CSS, and expose print action on form views. For spreadsheets, use list export or XLSX reporting modules with SQL views.
Steps
- Scaffold report XML with report_type qweb-pdf and model binding.
- Design QWeb template inheriting web.external_layout for headers and footers.
- Register report in __manifest__.py data files and security if new models.
- Add print button via ir.actions.report binding on form view.
- Test with sample records including multi-company and language translations.
- Tune paperformat margins for wkhtmltopdf; verify barcode fonts if needed.
- For aggregated reports, create SQL view model and pivot or XLSX export action.
Common mistakes
- Using HTML tags unsupported by wkhtmltopdf version on server.
- Missing t-lang on translated documents.
- Huge images in template slowing PDF generation.
- Report on transient model without storing data.
- Forgetting access rights on report-only models leaking data.
Odoo version notes
QWeb PDF reports work in Community and Enterprise 16–18; wkhtmltopdf version matters on Odoo.sh. Odoo 17+ improves report editor in some editions. Spreadsheet dashboard reports are Enterprise BI direction—custom SQL still common. Test print after each upgrade for layout shifts.
When to bring in help
If the fix touches custom modules, regulated traceability, or production outages, a focused rescue sprint beats months of trial and error. See our Odoo service.