Logo van Odoo Report

Odoo Report

Community
ahmed-lakosha
odoo-report

Professional Odoo Email Templates & QWeb Reports - Complete toolkit for creating, managing, and debugging email templates and PDF reports across Odoo 14-19. Includes wkhtmltopdf setup, Arabic/RTL support, bilingual patterns, and comprehensive validation. <example> Context: User wants to create an email template user: "Create an invoice confirmation email template in Odoo 17" assistant: "I will use the odoo-report skill to create a mail.template record with QWeb body, dynamic fields, and correct ir.attachment handling." <commentary>Core trigger - new email template creation.</commentary> </example> <example> Context: User wants a PDF report user: "Design a QWeb PDF report for purchase orders" assistant: "I will use the odoo-report skill to create a report action, QWeb template with page layout, header/footer, and register it in the module manifest." <commentary>PDF report workflow trigger.</commentary> </example> <example> Context: User has a broken email template user: "My email template is sending plain text instead of HTML" assistant: "I will use the odoo-report skill to diagnose the template body_html field, check subtype_id, and verify the mail.template arch is structured correctly for HTML rendering." <commentary>Debugging trigger - email template not rendering correctly.</commentary> </example> <example> Context: User wants to analyze a template user: "Analyze this email template for issues and improvements" assistant: "I will use the odoo-report skill to check template structure, context variables, rendering patterns, and suggest improvements." <commentary>Analyze trigger - template quality review.</commentary> </example> <example> Context: User wants to migrate templates between versions user: "Migrate my templates from Odoo 14 to 17" assistant: "I will use the odoo-report skill to apply version-specific transformations: t-esc to t-out, report_template to report_template_ids, and add template_category." <commentary>Migration trigger - version upgrade.</commentary> </example> <example> Context: User wants

Overzicht

Uitgeverahmed-lakosha
Repositoryodoo-plugins
Skillnaamodoo-report
Sterren
74
Forks
33
Meegeleverde bestanden
Alleen instructies
LicentieLGPL-3
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Compleet zonder extra bestanden

    Alles wat het model nodig heeft, staat in de instructies — geen extra bestanden om te synchroniseren.

  • Open source

    Gepubliceerd door ahmed-lakosha op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Odoo Report in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/ahmed-lakosha/odoo-plugins/tree/master/odoo-report-plugin/odoo-report
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ahmed-lakosha/odoo-plugins.git /tmp/odoo-plugins
mkdir -p .claude/skills
cp -r /tmp/odoo-plugins/odoo-report-plugin/odoo-report .claude/skills/odoo-report
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Odoo Report in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Odoo Report automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Odoo Report niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

Odoo Email Templates & QWeb Reports Skill (v2.1)

A skill for creating, managing, debugging, and migrating Odoo email templates and QWeb reports across versions 14-19.

Workflows

This skill handles all template and report workflows via natural language:

What you wantWhat to say
Create email template"Create an email template for sale.order quotation"
Create QWeb PDF report"Create a QWeb PDF report for purchase.order"
Migrate templates"Migrate this template from Odoo 14 to 17"
Analyze template"Analyze this template for issues"
Debug rendering"Debug why my email shows plain text"
Fix template"Fix the broken QWeb expressions"
Validate before deploy"Validate this template before deployment"
List templates"List all templates for sale.order"
Preview output"Preview this email template"

Configuration

  • Supported Versions: Odoo 14, 15, 16, 17, 18, 19
  • Core Model: mail.template
  • Rendering Engines: inline_template (Jinja2-like) for headers, QWeb for body_html

User overrides: Check for odoo-report.local.md in the project .claude/ directory. If found, use its YAML frontmatter settings (default_version, author, default_layout) as defaults.


Template Architecture

mail.template
├── Inherits: mail.render.mixin (rendering engine)
├── Inherits: template.reset.mixin (reset - Odoo 16+)
│
├── Header Fields (inline_template engine):
│   subject, email_from, email_to, email_cc, reply_to, partner_to
│
├── Content Fields (QWeb engine):
│   body_html
│
├── Attachment Fields:
│   attachment_ids (static)
│   report_template (Odoo 14-16) / report_template_ids (Odoo 17+)
│   report_name (dynamic filename)
│
└── Configuration:
    email_layout_xmlid, auto_delete, mail_server_id,
    use_default_to, scheduled_date, template_category (16+)

Rendering Flow

mail.template.send_mail_batch(res_ids)
  ├─► _generate_template(res_ids, render_fields)
  │     ├─► _classify_per_lang()
  │     ├─► _render_field() per field (inline_template or qweb)
  │     ├─► _generate_template_recipients()
  │     ├─► _generate_template_attachments() (static + PDF report)
  │     └─► Return rendered values dict
  ├─► Create mail.mail records
  ├─► Apply email_layout_xmlid (if set)
  └─► Send via mail_server_id or default

Two Rendering Engines

1. Inline Template (Jinja2-like)

Used for: subject, email_from, email_to, email_cc, reply_to, partner_to, lang, scheduled_date

python
{{ object.name }}
{{ object.partner_id.name }}
{{ (object.user_id.email_formatted or user.email_formatted) }}
{{ object.state == 'draft' and 'Quotation' or 'Order' }}
{{ ctx.get('proforma') and 'Proforma' or '' }}

2. QWeb Engine

Used for: body_html

xml
<!-- Output (use t-out for Odoo 15+, t-esc for Odoo 14) -->
<t t-out="object.name"/>
<t t-out="format_amount(object.amount_total, object.currency_id)"/>

<!-- Conditionals -->
<t t-if="object.state == 'draft'">Draft</t>
<t t-elif="object.state == 'sent'">Sent</t>
<t t-else="">Confirmed</t>

<!-- Loops -->
<t t-foreach="object.order_line" t-as="line">
    <tr><td t-out="line.name"/></tr>
</t>

<!-- Dynamic attributes -->
<a t-att-href="object.get_portal_url()">View</a>

Version Decision Matrix

Feature141516171819
Output tagt-esct-outt-outt-outt-outt-out
report_template (M2O)YYY---
report_template_ids (M2M)---YYY
template_category--YYYY
Company branding colors-----Y
format_datetime()-YYYYY
is_html_empty()--YYYY

Version Detection Priority

  1. User-specified --version flag
  2. Directory path (odoo14, odoo17, etc.)
  3. __manifest__.py version string (e.g., '17.0.1.0.0')
  4. Ask user if ambiguous

Email Layout Templates

LayoutWidthUse Case
mail.mail_notification_layout900pxFull notifications with header/footer
mail.mail_notification_light590pxSimple notifications
mail.mail_notification_layout_with_responsible_signature900pxUses record's user_id signature (16+)

Best Practices

1. Always Use Fallbacks

xml
<t t-out="object.partner_id.name or 'Valued Customer'"/>

2. Use Format Helpers

xml
<t t-out="format_amount(object.amount_total, object.currency_id)"/>
<t t-out="format_date(object.date_order)"/>

3. Use Layouts for Consistency

xml
<field name="email_layout_xmlid">mail.mail_notification_layout</field>

4. Handle Empty HTML (16+)

xml
<t t-if="not is_html_empty(object.description)">
    <div t-out="object.description"/>
</t>

5. Version-Appropriate Output

xml
<!-- Odoo 15+ --> <t t-out="value"/>
<!-- Odoo 14 -->  <t t-esc="value"/>

6. Report Attachment by Version

xml
<!-- Odoo 14-16 -->
<field name="report_template" ref="module.report_action"/>
<!-- Odoo 17+ -->
<field name="report_template_ids" eval="[(4, ref('module.report_action'))]"/>

7. Email Tables for Compatibility

xml
<!-- Email clients require table-based layout with inline styles -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr><td style="padding: 20px;">Content</td></tr>
</table>

8. Safe Dynamic Filenames

xml
<field name="report_name">{{ (object.name or 'Document').replace('/', '-') }}</field>

wkhtmltopdf (Required for PDF Reports)

Installation

bash
# Windows
winget install wkhtmltopdf.wkhtmltox

# Ubuntu/Debian
sudo apt-get install wkhtmltopdf

# macOS
brew install wkhtmltopdf

Odoo Configuration (MANDATORY)

ini
[options]
bin_path = C:\Program Files\wkhtmltopdf\bin   # Windows
# bin_path = /usr/local/bin                    # Linux

Key Limitation: OFFLINE Mode

wkhtmltopdf runs WITHOUT network access:

  • Google Fonts CDN will NOT load
  • External images will NOT render
  • Use web.external_layout for fonts
  • Use system fonts: 'DejaVu Sans', 'Arial', sans-serif

Common Errors

ErrorCauseSolution
Unable to find Wkhtmltopdfbin_path not configuredAdd bin_path to odoo.conf
PDF generation timeoutExternal resources requestedRemove CDN URLs
Blank PDF generatedCSS/SCSS errorsValidate SCSS syntax
Exit with code 1HTML syntax errorValidate QWeb XML

Arabic/RTL Support

MANDATORY Template Wrapper for Non-Latin Text

xml
<template id="report_document">
    <t t-call="web.html_container">        <!-- Provides UTF-8 meta tag -->
        <t t-foreach="docs" t-as="o">
            <t t-call="web.external_layout"> <!-- Loads proper fonts -->
                <div class="page">
                    <!-- Content here -->
                </div>
            </t>
        </t>
    </t>
</template>

Without web.html_container, Arabic text displays as ÙØ§ØªÙˆØ±Ø© (UTF-8 bytes read as Latin-1).

Bilingual Labels

xml
<th style="background: #1a5276; color: white; padding: 12px;">
    Date | التاريخ
</th>

RTL Alignment

xml
<div style="direction: rtl; text-align: right;">
    يرجى إرسال حوالاتكم على الحساب المذكور أعلاه
</div>

Report SCSS Styling

Asset Bundle

python
'assets': {
    'web.report_assets_common': [
        'module/static/src/scss/report_styles.scss',
    ],
},

Google Fonts Pitfall

scss
// BROKEN - Semicolons in URL break SCSS parsing
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

// FIXED - Use weight range syntax
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300..700&display=swap');

// BEST - Don't use Google Fonts (wkhtmltopdf is offline!)

Recommended Font Stack

scss
$report-font-family: 'DejaVu Sans', 'Arial', 'Helvetica', sans-serif;

Paper Format Configuration

xml
<record id="paperformat_custom" model="report.paperformat">
    <field name="name">Custom A4</field>
    <field name="format">A4</field>
    <field name="orientation">Portrait</field>
    <field name="margin_top">20</field>
    <field name="margin_bottom">20</field>
    <field name="margin_left">15</field>
    <field name="margin_right">15</field>
    <field name="header_line" eval="False"/>
    <field name="dpi">90</field>
</record>

Link to report: <field name="paperformat_id" ref="module.paperformat_custom"/>

FormatDimensionsUse Case
A4210 x 297 mmStandard international
Letter216 x 279 mmUS standard
Legal216 x 356 mmLegal documents
LandscapeAny + LandscapeWide tables, charts

Debug Workflow

When diagnosing report or template issues, follow this order:

  1. Infrastructure: wkhtmltopdf installed? bin_path in odoo.conf? Server restarted?
  2. Template structure: web.html_container → web.external_layout → div.page?
  3. Report action: report_name matches template id? binding_model_id correct?
  4. Shell test: env.ref('module.report_action')._render_qweb_pdf([record_id])
  5. Browser cache: Clear cache (Ctrl+Shift+R)

Reference Files

When working on specific tasks, read these files from the plugin directory for deeper context:

For template creation

  • Pattern selection by purpose/model: memories/template_patterns.md
  • Starter email XML: templates/email/basic_notification.xml, templates/email/document_email.xml
  • Starter report XML: templates/qweb/basic_report.xml, templates/qweb/table_report.xml
  • Field definitions: data/template_fields.json
  • Context variables by version: data/context_variables.json
  • Layout options: data/layouts.json

For version decisions

  • Version routing rules and migration paths: memories/version_routing.md
  • Version detection logic and feature map: helpers/version_helper.md

For validation

  • Pre-flight validation checklist: validators/template_validator.md

For QWeb quality

  • Safety, performance, email/report guidelines: memories/qweb_best_practices.md

For module-specific templates

  • Known Odoo template IDs by module: data/module_templates.md

Migration Reference

Automatic Transformations

From → ToTransformation
14 → 15+t-esc → t-out, t-raw → t-out
14-16 → 17+report_template → report_template_ids with eval="[(4, ref(...))]"
Any → 16+Add template_category field
Any → 19Add company branding: company.email_secondary_color, company.email_primary_color

Migration Workflow

  1. Detect source version (syntax heuristics or directory name)
  2. Create backup: {file}.bak
  3. Apply transformations in order
  4. Validate migrated XML
  5. Show diff summary

For full migration matrix and rules, read memories/version_routing.md.


Common Errors

ErrorCauseSolution
AttributeError: 'NoneType' has no attribute 'name'Null field accessUse object.field.name or ''
QWebException: t-esc is deprecatedOld syntax in 15+Replace t-esc with t-out
KeyError: 'format_amount'Missing context helperEnsure mail.render.mixin inherited
ValidationError: Invalid XMLMalformed QWebCheck tag closure
Arabic text as ÙØ§ØªÙˆØ±Ø©Missing web.html_containerAdd UTF-8 wrapper
Blank PDFwkhtmltopdf not found or CSS errorCheck bin_path, validate SCSS

Veelgestelde vragen

Wat doet de AI-skill Odoo Report?

Professional Odoo Email Templates & QWeb Reports - Complete toolkit for creating, managing, and debugging email templates and PDF reports across Odoo 14-19. Includes wkhtmltopdf setup, Arabic/RTL support, bilingual patterns, and comprehensive validation. <example> Context: User wants to create an email template user: "Create an invoice confirmation email template in Odoo 17" assistant: "I will use the odoo-report skill to create a mail.template record with QWeb body, dynamic fields, and correct ir.attachment handling." <commentary>Core trigger - new email template creation.</commentary> </e...

Waarom Odoo Report gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Odoo Report bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Odoo Report in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/ahmed-lakosha/odoo-plugins/tree/master/odoo-report-plugin/odoo-report. TypingMind leest het bestand SKILL.md en installeert het als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Odoo Report gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Odoo Report gebruiken?

Zoveel als je wilt. Je kunt Odoo Report gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Odoo Report gratis?

Ja. Deze skill is door ahmed-lakosha op GitHub gepubliceerd onder de licentie LGPL-3. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇