odoo-qweb-templates – Documents & Office skill for AI agents
Expert in Odoo QWeb templating for PDF reports, email templates, and website pages. Covers t-if, t-foreach, t-field, and report actions.
Install the odoo-qweb-templates skill with one command
Pick the tool you use, copy the command and paste it in your terminal. The skill lands in that tool's skills folder and is ready in your next session.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/odoo-qweb-templates-56fc8.tgz | tar xz -C ~/.claude/skills
Call it in Claude Code: /odoo-qweb-templates – then describe the task you want done.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/odoo-qweb-templates-56fc8.tgz | tar xz -C ~/.codex/skills
Call it in Codex: $odoo-qweb-templates – then describe the task you want done.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/odoo-qweb-templates-56fc8.tgz | tar xz -C ~/.hermes/skills
Call it in Hermes Agent: /odoo-qweb-templates – then describe the task you want done.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/odoo-qweb-templates-56fc8.tgz | tar xz -C ~/.deepcode/skills
Call it in DeepSeek: /odoo-qweb-templates – then describe the task you want done.
SKILL.md content
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-foreachissues).
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
<!-- Report Action -->
<record id="action_report_patient_card" model="ir.actions.report">
<field name="name">Patient Card</field>
<field name="model">hospital.patient</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">hospital_management.report_patient_card</field>
<field name="binding_model_id" ref="model_hospital_patient"/>
</record>
<!-- QWeb Template -->
<template id="report_patient_card">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="doc">
<t t-call="web.external_layout">
<div class="page">
<h2>Patient Card</h2>
<table class="table table-bordered">
<tr>
<td><strong>Name:</strong></td>
<td><t t-field="doc.name"/></td>
</tr>
<tr>
<td><strong>Doctor:</strong></td>
<td><t t-field="doc.doctor_id.name"/></td>
</tr>
<tr>
<td><strong>Status:</strong></td>
<td><t t-field="doc.state"/></td>
</tr>
</table>
</div>
</t>
</t>
</t>
</template>Example 2: Conditional Rendering
<!-- Show a warning block only if the patient is not confirmed -->
<t t-if="doc.state == 'draft'">
<div class="alert alert-warning">
<strong>Warning:</strong> This patient has not been confirmed yet.
</div>
</t>Best Practices
- ✅ Do: Use
t-fieldfor model fields — Odoo auto-formats dates, monetary values, and booleans correctly. - ✅ Do: Use
t-outfor escaped output of ordinary strings;t-escremains an alias in Odoo 17. Values already marked safe require separate trust review. - ✅ Do: Call
web.external_layoutfor 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 inlinet-esc. - ❌ Don't: Put complex business logic or side effects in QWeb — simple expressions are supported; compute complex values in a model or report
_get_report_values()helper. - ❌ Don't: Forget
t-aswhen usingt-foreach; without it, you can't access the current record in the loop body. - ❌ Don't: Bypass escaping to render untrusted HTML. Sanitize rich content using the target Odoo version's supported mechanisms; marking content safe is a security assertion.
Reference: [Odoo 17 QWeb](https://www.odoo.com/documentation/17.0/developer/reference/frontend/qweb.html). The sample requires the custom model, fields, access rules and module XML wrapper; test rendering with an authorized user and avoid exposing patient data.
Limitations
- Does not cover website controller routing for dynamic QWeb pages — that requires Python
http.routeknowledge. - Email template QWeb has different variable scope than report QWeb (
objectvsdocs) — this skill primarily focuses on PDF reports. - QWeb JavaScript (used in Kanban/Form widgets) is a different engine; this skill covers server-side QWeb only.
- Does not cover wkhtmltopdf configuration for PDF rendering issues (page size, margins, header/footer overlap).
Related skills
- office-productivity – Office productivity workflow covering document creation, spreadsheet automation…
- onboard – Decompose mixed project materials (code, docs, PDF/Excel/PPT) into a sourced overview…
- patterns – Reference document for monopoly patterns.
- pdf-conversion-router – Use when converting a PDF into another format such as Markdown, HTML, text, JSON, DOCX…
- planning-with-files – Work like Manus: Use persistent markdown files as your \"working memory on disk.\
- pptx-deck-creation – Create editable, production-ready PPTX decks with narrative planning, explicit layout…
- presentation-deck – Build an evidence-linked slide register after context-first intake. Use when an SME…
- price-psychology-strategist – Design pricing presentation, anchors, and tiers when an offer needs clearer value and…