jpskill.com
📄 ドキュメント コミュニティ 🟢 非エンジニアでもOK 👤 事務職・営業・経理

📄 OdooQwebテンプレート

odoo-qweb-templates

OdooのQWebテンプレートを専門とし、PDFレポート、メールテンプレート、ウェブサイトページの作成において、t-if、t-foreach、t-fieldなどの機能やレポートアクションを効果的に活用するSkill。

⏱ CSVクリーニング 2時間 → 5分

📺 まず動画で見る(YouTube)

▶ Claude最新!PowerPoint, Excel, Wordを生成できる機能を解説 ↗

※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。

📜 元の英語説明(参考)

Expert in Odoo QWeb templating for PDF reports, email templates, and website pages. Covers t-if, t-foreach, t-field, and report actions.

🇯🇵 日本人クリエイター向け解説

一言でいうと

OdooのQWebテンプレートを専門とし、PDFレポート、メールテンプレート、ウェブサイトページの作成において、t-if、t-foreach、t-fieldなどの機能やレポートアクションを効果的に活用するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-17
同梱ファイル
1

💬 こう話しかけるだけ — サンプルプロンプト

  • Odoo Qweb Templates を使って、来週の会議資料の下書きを作って
  • Odoo Qweb Templates で、既存ファイルから必要な部分だけ抽出して
  • Odoo Qweb Templates で、提供されたテンプレートに沿って自動整形して

これをClaude Code に貼るだけで、このSkillが自動発動します。

📖 Claude が読む原文 SKILL.md(中身を展開)

この本文は AI(Claude)が読むための原文(英語または中国語)です。日本語訳は順次追加中。

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).