odoo-qweb-templates
Fungsinya
Alat ini membantu membuat template dokumen (seperti faktur PDF, email, dan halaman website) untuk sistem Odoo. Alat ini menghasilkan kode yang diperlukan untuk menampilkan informasi secara terorganisir dan dinamis.
Kapan dipakai
- βMembuat laporan PDF kustom baru.
- βMengembangkan template email otomatis.
- βMenambahkan konten dinamis ke halaman website.
Link skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/odoo-qweb-templates/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBuatkan template QWeb untuk faktur PDF yang menampilkan nama pelanggan dan total jumlah.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Anda menjelaskan dokumen yang Anda butuhkan (laporan, email, atau halaman). Alat ini akan membuat kode QWeb dan konfigurasi yang diperlukan agar Odoo dapat menggunakannya.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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).
Pertanyaan umum
Apa itu QWeb?
QWeb adalah bahasa yang digunakan Odoo untuk membuat template dokumen, seperti laporan PDF dan email, sehingga informasi bisa ditampilkan secara dinamis.
Apa itu 'directive' seperti t-if dan t-foreach?
Ini adalah perintah khusus di QWeb yang mengatur cara konten ditampilkan. Misalnya, 't-if' hanya menampilkan sesuatu jika suatu kondisi terpenuhi, dan 't-foreach' mengulang sebuah blok konten untuk setiap item dalam daftar.
Bisakah saya menggunakan ini untuk semua jenis dokumen di Odoo?
Terutama untuk laporan PDF, template email, dan halaman website. Alat ini tidak mencakup pemrograman Python untuk halaman web yang kompleks ataupun pengaturan cetak PDF.
Detail
Deskripsi asli dari pembuat
Expert in Odoo QWeb templating for PDF reports, email templates, and website pages. Covers t-if, t-foreach, t-field, and report actions.
Popularitas
- Bintang GitHub
- 48k
- Peringkat
- #5349
- Lisensi
- MIT
- Diperbarui
- 15/10/2026
Komentar
- β¦
Skill lain dari repositori ini
00-andruia-consultant
48kMembantu agent Anda memulai atau meningkatkan proyek AI. Agent menganalisis kode, menyarankan tools, dan membuat rencana aksi dalam bahasa Spanyol.
007
48kMemungkinkan agent Anda melakukan audit keamanan dan threat modeling. Berguna untuk melindungi proyek dari serangan dan celah keamanan.
10-andruia-skill-smith
48kMembantu agent Anda membuat atau meningkatkan tools AI. Agent mendefinisikan cara kerja tools, menulis dokumentasi, dan memvalidasi strukturnya.
20-andruia-niche-intelligence
48kMemungkinkan agent Anda membuat ringkasan industri tertentu. Berguna untuk memahami konteks, aturan, pola penggunaan, dan risiko proyek dengan sumber terpercaya.
Skill serupa
angular-developer
280kMembantu agent Anda membuat kode Angular dan memberi saran struktur proyek. Berguna saat memulai proyek baru, membuat komponen, atau meningkatkan performa.
frontend-a11y
280kMembantu agent Anda membuat antarmuka web dapat diakses semua orang. Memastikan website dan aplikasi berfungsi baik dengan screen reader dan navigasi keyboard.
frontend-patterns
280kMembuat agent Anda menerapkan pola modern dalam frontend. Mengoptimalkan performa, mengelola state, dan mengikuti praktik terbaik React dan Next.js.