Agent skill · writing content · sickn33

odoo-qweb-templates

Expert in Odoo QWeb templating for PDF reports, email templates, and website pages. Covers t-if, t-foreach, t-field, and report actions.

Why this skill is useful

Provides specific QWeb XML patterns and directives for generating Odoo PDF reports and email templates that the AI wouldn't reliably generate on its own.

What it needs

About 2k tokens when loaded. Last updated 2026-08-07. 44,571 stars on the source repository.

What this skill does

Odoo QWeb Templates Overview QWeb is Odoo's primary templating engine, used for PDF reports, website pages, and email templates. This skill generates correct, well-structured QWeb XML with proper directives, translation support, and report action bindings. When to Use This Skill Creating a custom PDF report (invoice, delivery slip, certificate). Building a QWeb email template triggered by workflow actions. Designing Odoo website pages with dynamic content. Debugging QWeb rendering errors (t-if, t-foreach issues). How It Works 1. Activate: Mention @odoo-qweb-templates and describe the report or template needed. 2. Generate: Receive a complete ir.actions.report record and QWeb template. 3. Debug: Paste a broken template to identify and fix rendering issues. Examples Example 1: Custom PDF Report Example 2: Conditional Rendering Best Practices ✅ Do: Use t-field for model fields — Odoo auto-formats dates, monetary values, and booleans correctly. ✅ Do: Use t-out (Odoo 15+) for safe HTML output of non-field strings. Use t-esc only on Odoo 14 and below (it HTML-escapes output). ✅ Do: Call web.externallayout for PDF reports to automatically include the company header, footer, and logo. ✅ Do: Use lt() (lazy translation) for translatable string literals inside Python report helpers, not inline t-esc. ❌ Don't: Use raw Python expressions inside QWeb — compute values in the model or a report getreportvalues() helper. ❌ Don't: Forget t-as when using t-foreach; without it, you can't access the current record in the loop body. ❌ Don't: Use t-esc where you intend to render HTML content — it will escape the tags and print them as raw text. Limitations Does not cover website controller routing for dynamic QWeb pages — that requires Python http.route knowledge. Email template QWeb has different variable scope than report QWeb (object vs docs) — this skill primarily focuses on PDF reports. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills sickn33/odoo-qweb-templates

View the source on GitHub

Browse the @skills marketplace