odoo-qweb-templates
यह क्या करती है
यह टूल Odoo सिस्टम के लिए दस्तावेज़ टेम्पलेट (जैसे PDF invoice, ईमेल और वेबसाइट पेज) बनाने में मदद करता है। यह जानकारी को व्यवस्थित और डायनामिक तरीके से दिखाने के लिए ज़रूरी कोड बनाता है।
कब इस्तेमाल करें
- ✓एक नई कस्टम PDF रिपोर्ट बनाना।
- ✓अपने आप भेजे जाने वाले ईमेल का टेम्पलेट बनाना।
- ✓वेबसाइट पेज में डायनामिक कंटेंट जोड़ना।
Skill का लिंक
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/odoo-qweb-templates/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“एक PDF invoice के लिए QWeb टेम्पलेट बनाओ जिसमें ग्राहक का नाम और कुल रकम दिखे।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
आप जिस दस्तावेज़ की ज़रूरत है (रिपोर्ट, ईमेल या पेज) उसका विवरण देते हैं। टूल QWeb कोड बनाता है और Odoo उसे इस्तेमाल कर सके, इसके लिए ज़रूरी सेटिंग्स भी बनाता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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).
अक्सर पूछे जाने वाले सवाल
QWeb क्या है?
QWeb वह भाषा है जिसे Odoo दस्तावेज़ टेम्पलेट बनाने के लिए इस्तेमाल करता है, जैसे PDF रिपोर्ट और ईमेल। इससे जानकारी डायनामिक तरीके से दिखाई जा सकती है।
t-if और t-foreach जैसे 'directives' क्या हैं?
ये QWeb में खास कमांड हैं जो तय करते हैं कि कंटेंट कैसे दिखेगा। उदाहरण के लिए 't-if' किसी चीज़ को तभी दिखाता है जब कोई शर्त सही हो, और 't-foreach' किसी लिस्ट के हर आइटम के लिए एक ब्लॉक को बार-बार दोहराता है।
क्या मैं इसे Odoo के किसी भी तरह के दस्तावेज़ के लिए इस्तेमाल कर सकता हूँ?
मुख्य रूप से यह PDF रिपोर्ट, ईमेल टेम्पलेट और वेबसाइट पेज के लिए है। यह जटिल वेब पेज के लिए Python प्रोग्रामिंग या PDF प्रिंटिंग सेटिंग्स को कवर नहीं करता।
जानकारी
लेखक का मूल विवरण
Expert in Odoo QWeb templating for PDF reports, email templates, and website pages. Covers t-if, t-foreach, t-field, and report actions.
लोकप्रियता
- GitHub स्टार
- 48k
- रैंकिंग में स्थान
- #5349
- लाइसेंस
- MIT
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
00-andruia-consultant
48kआपके एजेंट को AI प्रोजेक्ट शुरू करने या उन्हें बेहतर बनाने में मदद करता है। यह code का विश्लेषण करता है, tools सुझाता है और स्पेनिश भाषा में action plan बनाता है।
007
48kआपका एजेंट security audit और threat modeling करता है। यह प्रोजेक्ट को हमलों और कमजोरियों से बचाने में काम आता है।
10-andruia-skill-smith
48kआपके एजेंट को AI tools बनाने या उन्हें बेहतर करने में मदद करता है। यह तय करता है कि tools कैसे काम करेंगे, documentation लिखता है और structure की जांच करता है।
20-andruia-niche-intelligence
48kआपका एजेंट किसी खास industry का summary बनाता है। भरोसेमंद स्रोतों की मदद से यह प्रोजेक्ट का संदर्भ, नियम, इस्तेमाल के तरीके और जोखिम समझने में मदद करता है।
मिलती-जुलती skills
angular-developer
280kआपके एजेंट को Angular code बनाने और प्रोजेक्ट स्ट्रक्चर पर सलाह देने में मदद करता है। नए प्रोजेक्ट शुरू करने, code के हिस्से बनाने, या performance और accessibility सुधारने में उपयोगी है।
frontend-a11y
280kआपके एजेंट को web interfaces को सबके लिए accessible बनाने में मदद करता है। यह सुनिश्चित करता है कि websites और apps screen readers और keyboard navigation के साथ अच्छे से काम करें।
frontend-patterns
280kआपके एजेंट को React और Next.js में frontend development के modern patterns लागू करने में मदद करता है। यह performance optimize करता है, state manage करता है और best practices फॉलो करवाता है।