본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)48k · #5349

odoo-qweb-templates

하는 일

이 도구는 Odoo 시스템의 문서 템플릿(PDF 송장, 이메일, 웹사이트 페이지 등)을 만드는 데 도움을 줍니다. 정보를 체계적이고 동적으로 표시하는 코드를 생성합니다.

사용하는 경우

  • ✓새 맞춤 PDF 보고서를 만들 때.
  • ✓자동 이메일 템플릿을 개발할 때.
  • ✓웹사이트 페이지에 동적 콘텐츠를 추가하는 경우.

스킬 링크

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에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/odoo-qweb-templates/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“고객 이름과 총액을 보여 주는 PDF 송장용 QWeb 템플릿을 만들어 주세요.”

매주 새 스킬 5개. 읽는 데 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-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

<!-- 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-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.external_layout 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 _get_report_values() 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.
  • 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이란 무엇인가요?

Odoo가 PDF 보고서나 이메일 같은 문서 템플릿을 만들 때 쓰는 언어로, 정보를 동적으로 표시할 수 있게 합니다.

‘t-if’나 ‘t-foreach’ 같은 지시어는 무엇인가요?

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.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#5349
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬