odoo-qweb-templates
Helps your agent create reports and web pages in Odoo. It uses a template system to generate documents and emails.
What it does
This tool helps create document templates (like PDF invoices, emails, and website pages) for the Odoo system. It generates the necessary code to display information in an organized and dynamic way.
When to use it
- ✓Creating a new custom PDF report.
- ✓Developing an automatic email template.
- ✓Adding dynamic content to a website page.
Example of what to ask your AI
“Create a QWeb template for a PDF invoice showing the customer name and total amount.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
You describe the document you need (report, email, or page). The tool generates the QWeb code and the necessary configurations for Odoo to use it.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add sickn33/agentic-awesome-skills --skill odoo-qweb-templatesOr download just the file:
curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/odoo-qweb-templates/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
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
- Activate: Mention
@odoo-qweb-templatesand describe the report or template needed. - Generate: Receive a complete
ir.actions.reportrecord and QWeb template. - 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-out(Odoo 15+) for safe HTML output of non-field strings. Uset-esconly on Odoo 14 and below (it HTML-escapes output). - ✅ 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: Use raw Python expressions inside QWeb — compute values in the model or a 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: Use
t-escwhere 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.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).
FAQ
What is QWeb?
QWeb is the language Odoo uses to create document templates, like PDF reports and emails, allowing information to be displayed dynamically.
What are 'directives' like t-if and t-foreach?
These are special commands in QWeb that control how content is displayed. For example, 't-if' shows something only if a condition is true, and 't-foreach' repeats a block of content for each item in a list.
Can I use this for any type of document in Odoo?
Mainly for PDF reports, email templates, and website pages. It doesn't cover Python programming for complex web pages or PDF printing settings.
Details
Original description by the author
Expert in Odoo QWeb templating for PDF reports, email templates, and website pages. Covers t-if, t-foreach, t-field, and report actions.
Popularity
- GitHub stars
- 48k
- Ranking position
- #3735
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
00-andruia-consultant
Helps your agent start or improve AI projects. It analyzes code, suggests tools, and creates action plans in Spanish.
sickn33/agentic-awesome-skills
007
Lets your agent perform security audits and threat modeling. It's useful for protecting projects against attacks and vulnerabilities.
sickn33/agentic-awesome-skills
10-andruia-skill-smith
Helps your agent create or improve AI tools. It defines how tools work, writes documentation, and validates the structure.
sickn33/agentic-awesome-skills
20-andruia-niche-intelligence
Lets your agent create a summary about a specific industry. It's useful for understanding the context, rules, usage patterns, and risks of a project, using reliable sources.
sickn33/agentic-awesome-skills
Similar skills
angular-developer
Helps your agent create Angular code and give project structure advice. Useful for starting new projects, creating code parts, or improving performance and accessibility.
affaan-m/ECC
frontend-a11y
Helps your agent make web interfaces accessible to everyone. It ensures websites and apps work well with screen readers and keyboard navigation.
affaan-m/ECC
frontend-patterns
Has your agent apply modern patterns in frontend development. It optimizes performance, manages state, and follows best practices in React and Next.js.
affaan-m/ECC