Report Designer - Word & Excel Template Engine
by Steven Marp https://apps.odoo.com/apps/browse?repo_maintainer_id=512936$ 99.00
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 2143 |
| Technical Name |
sm_report_designer |
| License | OPL-1 |
| Website | https://apps.odoo.com/apps/browse?repo_maintainer_id=512936 |
| Versions | 19.0 |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 2143 |
| Technical Name |
sm_report_designer |
| License | OPL-1 |
| Website | https://apps.odoo.com/apps/browse?repo_maintainer_id=512936 |
| Versions | 19.0 |
Report Designer — Word & Excel Template Engine
Design professional Odoo 19 reports from .docx and .xlsx templates — no developer needed
Module Video Overview
Features
1 Word & Excel templates
Upload |
2 Auto-detect & field mapping
Click Parse Template and all |
3 Multi-format outputGenerate reports as PDF, DOCX, XLSX, HTML, ODT, or RTF. PDF conversion is powered by LibreOffice headless for pixel-perfect output. Keep the original format or convert to any supported format with one click.
PDF
DOCX
XLSX
HTML
ODT
RTF
|
4 Table row loops
Use |
5 Python expressions
Write inline calculations directly in your template: |
6 Conditional blocks
Show or hide entire paragraphs/rows based on conditions: |
7 Format pipesFormat values inline without custom code. Available pipes:
|currency
|date
|datetime
|number
|upper
|lower
|title
|
8 Image support
Insert images from binary fields with |
9 PDF merge & cover pageSelect multiple records and generate a single merged PDF. Upload an optional DOCX cover page template — it renders with the same record data and gets prepended as the first page automatically. Perfect for batch-printing invoices, quotations, or delivery slips. |
10 Domain-based template selectionSet domain conditions per template. The system auto-selects the right template based on record data — different layouts for different customer types, order amounts, or any other criteria. Fully configurable from the UI. |
11 PDF preview in browserPreview reports inline in the browser before downloading. Quick verification without leaving Odoo. Accessible via button or direct URL endpoint. |
Template Syntax
{{name}} → record field value// Relational field (dot notation)
{{partner_id.name}} → related record value// Format pipes
{{amount_total|currency}} → Rp 15,000,000.50{{date_order|date}} → 04/14/2026{{name|upper}} → S00001// Python expression
{{=amount_untaxed * 0.11}} → calculated value{{=round(amount_total * 0.1, 2)}} → rounded// Conditional block
{{#if amount_tax}}Tax:
{{amount_tax}}{{#else}}No tax applied.
{{/if}}// Table loop (One2many)
{{#order_line}}{{product_id}} | {{product_uom_qty}} | {{price_subtotal|currency}}{{/order_line}}// Image from binary field
{{img:company_id.logo}} → embedded image
How It Works
|
1
Design TemplateCreate a Word or Excel file with |
2
Upload & ParseUpload to Odoo, select the model, click Parse Template. |
3
Map FieldsMap each placeholder to an Odoo field via dropdown selectors. |
4
ActivateClick Activate to register a print action on the model. |
5
Print!Users click the action menu to generate the report instantly. |
Requirements
|
✓ Odoo 19 Community or Enterprise |
|
✓ LibreOffice installed on server (for PDF/HTML/ODT/RTF conversion) |
|
✓ PyPDF2 or pypdf (for PDF merge feature, optional) |
|
✓ Pillow (PIL) for image size detection (optional, uses struct fallback) |
Support
We provide free bug fixes and updates for all our modules. If you need help, please submit a support request through the Odoo Apps support page. Our team is always ready to assist you.
Report Designer — Word & Excel Template Engine for Odoo 19
Table of Contents
1. Getting Started
Installation
- Upload the sm_report_designer module folder to your server's custom addons directory.
- Restart the Odoo service to detect the new module.
- Navigate to Apps menu, click Update Apps List.
- Search for "Report Designer" and click Install.
Note
After installation, a new menu item appears under Settings → Technical → Reporting → Report Designer.
2. Creating Your First Template
Step 1: Design the Template
Open Microsoft Word, LibreOffice Writer, or Google Docs and create your report layout. Use {{field_name}} placeholders wherever you want Odoo data to appear.
Example Word template:
SALES ORDER: {{name}}
Customer: {{partner_id}}
Date: {{date_order}}
Total: {{amount_total}}
Save the file as .docx (or .xlsx for spreadsheet reports).
Step 2: Upload & Configure
- Go to Settings → Technical → Reporting → Report Designer
- Click Create
- Fill in:
- Name: e.g., "Sales Order Quotation"
- Model: Select the target Odoo model (e.g., sale.order)
- Template File: Upload your .docx or .xlsx file
- Output Format: Choose PDF, Original, HTML, ODT, or RTF
Step 3: Parse & Map Fields
- Go to the Field Mappings tab
- Click the Parse Template button
- All {{placeholder}} patterns are auto-detected
- For each placeholder, select the correct Odoo field from the dropdown
- Use dot notation for relational fields: partner_id.name, company_id.logo
Step 4: Activate
- Click the Activate button at the top of the form
- A new action is registered on the target model
- Users can now find the report in the model's Action menu
Step 5: Generate Report
- Open any record of the target model (e.g., a Sale Order)
- Click Action menu → select your report template
- The report is generated and downloaded automatically
3. Template Syntax
Simple Placeholders
Replace with the value of a field on the current record:
{{name}} → "S00042"
{{partner_id}} → "Azure Interior"
{{amount_total}} → "15000000.5"
Dot Notation (Relational Fields)
Access fields on related records using dots:
{{partner_id.name}} → "Azure Interior"
{{partner_id.email}} → "azure@example.com"
{{company_id.name}} → "My Company"
{{partner_id.country_id.name}} → "Indonesia"
Format Pipes
Append |format to format values inline:
{{amount_total|currency}} → "Rp 15,000,000.50" (locale-aware)
{{date_order|date}} → "04/14/2026" (locale-aware)
{{create_date|datetime}} → "04/14/2026 10:30:00"
{{amount_untaxed|number}} → "12,000,000.00"
{{name|upper}} → "S00042"
{{name|lower}} → "s00042"
{{partner_id|title}} → "Azure Interior"
Python Expressions
Prefix with = to evaluate Python expressions:
{{=amount_untaxed + amount_tax}} → sum of two fields
{{=round(amount_total * 0.1, 2)}} → 10% rounded
{{=amount_untaxed * 0.11}} → PPN 11%
{{='PAID' if state == 'sale' else 'DRAFT'}}
Available variables in expressions:
- All record fields (by name)
- record — the current Odoo record object
- user — current user (self.env.user)
- env — the Odoo environment
- time, datetime — Python standard library modules
Warning
Expressions are evaluated using Odoo's safe_eval for security. Dangerous operations (file I/O, imports, etc.) are blocked.
Conditional Blocks
Show or hide paragraphs/rows based on conditions:
{{#if amount_tax}}
Tax Amount: {{amount_tax|currency}}
This order includes tax.
{{#else}}
This order is tax-free.
{{/if}}
Important rules:
Each {{#if ...}}, {{#else}}, and {{/if}} must be on its own paragraph (DOCX) or row (XLSX).
Do NOT mix conditional tags with other content on the same line.
Nesting is supported:
{{#if partner_id}} Customer: {{partner_id}} {{#if amount_tax}} Tax: {{amount_tax}} {{/if}} {{/if}}Conditions can be simple field names (truthy check) or expressions:
{{#if amount_tax}} → true if amount_tax is non-zero/non-empty {{#if state == 'sale'}} → expression evaluation
Table Row Loops
Repeat table rows for One2many/Many2many fields:
+-----------+----------------+--------+-----------+
| No | Product | Qty | Subtotal |
+-----------+----------------+--------+-----------+
| {{#order_line}} |
+-----------+----------------+--------+-----------+
| {{sequence}} | {{product_id}} | {{product_uom_qty}} | {{price_subtotal}} |
+-----------+----------------+--------+-----------+
| {{/order_line}} |
+-----------+----------------+--------+-----------+
The rows between {{#order_line}} and {{/order_line}} are repeated for each record in the order_line One2many field.
Setup: In Field Mappings, map order_line as a loop field pointing to the One2many relation (e.g., order_line). Map sub-fields (sequence, product_id, etc.) within the loop context.
Image Insertion
Insert binary field images with the img: prefix:
{{img:company_id.logo}} → company logo
{{img:partner_id.image_128}} → partner avatar
{{img:product_id.image_256}} → product image
DOCX behavior:
- Images are embedded as inline drawings in the document
- Auto-resized to max 15cm × 10cm with preserved aspect ratio
- Supports PNG, JPEG, GIF, WEBP, BMP formats
XLSX behavior:
- Images are inserted using openpyxl's Image class
- Anchored to the cell where the placeholder was
4. Advanced Features
PDF Merge
Combine multiple records into a single PDF:
- Open your template settings
- Check the Merge PDF checkbox
- Set Output Format to PDF
- In a list view, select multiple records
- Click Action → your template
- One merged PDF is downloaded
Cover Page
Add a professional cover page to your PDF:
- Set Output Format to PDF (the Cover Page tab appears)
- Go to the Cover Page tab
- Upload a .docx file as the cover template
- Use the same {{placeholder}} syntax — the cover is rendered with the same record data
- The cover page is automatically prepended to the PDF output
Domain-Based Templates
Create multiple templates for the same model with different conditions:
- Template A: Domain [('amount_total', '>', 10000000)] → for large orders
- Template B: Domain [('amount_total', '<=', 10000000)] → for small orders
The system auto-selects the matching template when generating a report.
PDF Preview
Preview reports in the browser before downloading:
- Click the Preview button on the template form
- Or access directly: /report_designer/preview/<template_id>/<record_id>
- PDF is displayed inline in the browser (not downloaded)
5. Output Formats
| Format | File Extension | Notes |
|---|---|---|
| Original | .docx / .xlsx | Keeps the template format as-is |
| Requires LibreOffice. Supports merge & cover | ||
| HTML | .html | Requires LibreOffice for conversion |
| ODT | .odt | OpenDocument format. Requires LibreOffice |
| RTF | .rtf | Rich Text Format. Requires LibreOffice |
6. Troubleshooting
LibreOffice not found
If PDF conversion fails with "LibreOffice not found":
- Install LibreOffice: sudo apt install libreoffice
- Verify: libreoffice --version
- Ensure the libreoffice binary is in the system PATH
Placeholders not replaced
- Make sure you clicked Parse Template after uploading
- Check that each placeholder is mapped to a valid field
- For relational fields, use dot notation: partner_id.name (not just partner_id)
- Verify the field exists on the selected model
Images not showing
- Ensure the binary field contains actual image data (not empty)
- Check the field path: company_id.logo (not company_id.logo_web)
- Supported formats: PNG, JPEG, GIF, WEBP, BMP
- Maximum size: 15cm × 10cm (auto-scaled with aspect ratio)
Conditional blocks not working
- Each {{#if}}, {{#else}}, {{/if}} must be on its own paragraph (DOCX) or own row (XLSX)
- Do NOT put other text on the same line as a conditional tag
- Check for typos: {{#if field}} not {{# if field}}
7. Changelog
Version 19.0.3.0.0
- Added Python expressions {{=expr}}
- Added conditional blocks {{#if}}/{{#else}}/{{/if}}
- Added format pipes {{field|format}} (currency, date, datetime, number, upper, lower, title)
- Added image support {{img:field}} for DOCX and XLSX
- Added cover page support (PDF only)
Version 19.0.2.0.0
- Added PDF merge for multiple records
- Added domain-based template selection
- Added PDF preview in browser
- Added direct URL endpoints for preview and download
Version 19.0.1.0.0
- Initial release
- Word (.docx) and Excel (.xlsx) template support
- Auto-detect placeholders
- Field mapping via UI
- Table row loops for One2many fields
- Multi-format output (PDF, HTML, ODT, RTF)
- One-click print action
- Batch generation with ZIP download
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module