コンテンツへスキップ
Odoo メニュー
  • サインイン
  • 無料で15日試す
  • アプリ
    財務
    • 会計
    • 請求
    • 経費
    • スプレッドシート(BI)
    • ドキュメント管理
    • 署名
    販売
    • CRM
    • 販売
    • POSショップ
    • POSレストラン
    • サブスクリプション
    • レンタル
    ウェブサイト
    • ウェブサイトビルダー
    • eコマース
    • ブログ
    • フォーラム
    • ライブチャット
    • eラーニング
    サプライチェーン
    • 在庫
    • 製造
    • 製品ライフサイクル管理 (PLM)
    • 購買
    • 整備
    • 品質
    人事業務
    • 従業員管理
    • 採用
    • 休暇管理
    • 人事評価
    • リファラル
    • フリート
    マーケティング
    • ソーシャルマーケティング
    • メールマーケティング
    • SMSマーケティング
    • イベント
    • マーケティングオートメーション
    • アンケート調査
    サービス
    • プロジェクト管理
    • タイムシート
    • フィールドサービス
    • ヘルプデスク
    • 計画
    • アポイントメント
    生産性向上ツール
    • ディスカッション
    • 人工知能
    • IoT
    • VoIP
    • ナレッジ
    • WhatsApp
    サードパーティアプリ Odooスタジオ Odooクラウドプラットホーム
  • インダストリー(業種別ソリューション)
    小売
    • 書店
    • アパレルショップ
    • 家具店
    • 食料品店
    • 金物店
    • 玩具店
    飲食・ホスピタリティ業界
    • バー・パブ
    • レストラン
    • ファストフード
    • ゲストハウス
    • 飲料販売代理店
    • ホテル
    不動産
    • 不動産会社
    • 建築事務所
    • 建設
    • 不動産管理
    • 造園
    • 住宅所有者組合
    コンサルティング
    • 会計事務所
    • Odooパートナー
    • マーケティングエージェンシー
    • 法律事務所
    • 人材派遣
    • 監査・認証
    製造
    • テキスタイル
    • 金属
    • 家具
    • 飲食
    • ブルワリー
    • コーポレートギフト
    ヘルス & フィットネス
    • スポーツクラブ
    • 眼鏡店
    • フィットネスセンター
    • ウェルネス専門家
    • 薬局
    • ヘアサロン
    業種
    • 便利屋
    • IT ハードウェア・サポート
    • 太陽エネルギーシステム
    • 靴メーカー
    • クリーニングサービス
    • 空調設備サービス
    その他
    • 非営利団体
    • 環境機関
    • ビルボードレンタル
    • 写真
    • 自転車リース
    • ソフトウェアリセラー
    すべての業種を見る
  • コミュニティ
    学ぶ
    • チュートリアル
    • ドキュメンテーション
    • 認定
    • トレーニング
    • ブログ
    • ポッドキャスト
    教育サポート
    • 教育プログラム
    • Scale Up! ビジネスゲーム
    • Odooオフィス訪問
    ソフトを入手
    • ダウンロード
    • エディションを比較
    • リリース
    コラボレーション
    • Github
    • フォーラム
    • イベント
    • 翻訳
    • パートナーになる
    • パートナー様向けサービス
    • 会計事務所を登録
    サービス利用
    • パートナー一覧
    • 会計事務所一覧
    • 今すぐ相談する
    • 導入支援サービス
    • お客様一覧
    • サポート
    • アップグレード
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    製品デモを利用する
  • 料金
  • ヘルプ
コミュニティで交流するには登録する必要があります。
全てのポスト 人々 バッジ
タグ (全て表示)
odoo accounting v14 pos v15
このフォーラムについて
コミュニティで交流するには登録する必要があります。
全てのポスト 人々 バッジ
タグ (全て表示)
odoo accounting v14 pos v15
このフォーラムについて
ヘルプ

Available variables in email templates

購読

この投稿に活動があった際に通知を受け取ります

この質問にフラグが付けられました
qwebemailtemplatearray
1 返信
790 ビュー
アバター
Luc Bernard

I want to know which variables i have available in my email templates.

How can I display all keys and values of the object-array to see what's available?

Something like this?

<t t-foreach=“object[]”>

    <t t-out="object[key]”/>: <t t-out="object[value]”/><br/>

</t>

0
アバター
破棄
Codesphere Tech

Hello
Try this
<t t-foreach="object._fields" t-as="field_name">
<t t-if="object[field_name]">
<t t-esc="field_name"/>:
<t t-esc="object[field_name]"/><br/>
</t>
</t>

Luc Bernard
著作者

@Codesphere Tech When I add this I get this error:
Error: You do not have enough rights to access the field "milestone_count" on Project (project.project). Please contact your system administrator.

Codesphere Tech

Please verify that you are logged in as Administrator.

Luc Bernard
著作者

@Codesphere Yes I am. I'm even in Developer Mode. It works in most of them but not when 'Applies to: Project' and that's exactly where I need it.

Codesphere Tech

I will check for Email Template: Applies To: Project and let you know here.

Codesphere Tech

Some fields are restricted to specific user groups (for example, fields like milestone_count or duration_tracking in Projects). Even if you are logged in as Administrator or using Developer Mode, it does not guarantee access to those fields, because field-level security depends on group membership.
-> So I suggest that use specific known fields in the template or you can add admin to project group(not recommended).

Luc Bernard
著作者

@Codesphere

[-> So I suggest that use specific known fields in the template...]

That's exactly what I need this for, to see which variables are available.

[... or you can add admin to project group(not recommended)]

I am the creator/owner of the db so how can I get more rights than the ones I already have? Or is there a way to exclude these restricted variables from the query?

Codesphere Tech

Hello,
Being the database owner or Administrator doesn’t automatically give unrestricted access to every field in Odoo.
Some fields are protected by field-level security or internal logic, so they may still be restricted even for admin users.
If you need access, you can:
-> Add your user to the relevant functional group (in this case, Project-related groups), if appropriate
-> Check available fields via Settings → Technical → Database Structure → Fields and filter by the Project model
I’ll explore other solutions for this.

アバター
Javier Garcia
最善の回答

In Odoo email templates, object is not a dictionary; it's a recordset, so you can't iterate it with t-foreach="object[]". Here's what's actually available:

Standard variables in every email template:

  • object; the record the template is applied to (e.g. sale.order record)
  • user; the current user (res.users)
  • ctx; the context dictionary

To inspect available fields on object, the easiest approach is to temporarily put this in the template body:

<t t-foreach="object._fields" t-as="field">
    <t t-out="field"/>: <t t-out="object[field]"/><br/>
</t>

This iterates over all field names on the model and prints their values.

Or just check the model directly; go to Settings → Technical → Database Structure → Models, find your model (e.g. sale.order), and the Fields tab shows everything available via object.field_name.

Common usage examples:

<t t-out="object.name"/>           <!-- record name -->
<t t-out="object.partner_id.name"/> <!-- related field -->
<t t-out="user.name"/>             <!-- current user -->
<t t-out="object.amount_total"/>   <!-- numeric field -->

For formatted dates/currency use the format_date() and format_amount() helpers available in the template context.

0
アバター
破棄
ディスカッションを楽しんでいますか?読むだけでなく、参加しましょう!

今すぐアカウントを作成して、限定機能を利用したり、素晴らしいコミュニティと交流しましょう!

登録
関連投稿 返信 ビュー 活動
Add dynamic email reply to link email odoo v16
qweb emailtemplate V16
アバター
0
8月 24
2567
t-att-href button not rendered in outlook
qweb emailtemplate email_template
アバター
アバター
1
3月 23
4801
How to make a email with the orderd products in the body (qweb or jinja2)
qweb emailtemplate jinja2 odoo10
アバター
2
8月 18
4950
Use QWeb Rendering Engine in Odoo 9 for E-Mail Templates
qweb mass_mailing emailtemplate odoo9
アバター
アバター
1
12月 17
7128
Odoo 18: Display image from char field containing url in qweb form
qweb
アバター
アバター
1
7月 25
5002
コミュニティ
  • チュートリアル
  • ドキュメンテーション
  • フォーラム
オープンソース
  • ダウンロード
  • Github
  • Runbot
  • 翻訳
サービス
  • Odoo.shホスティング
  • サポート
  • アップグレード
  • カスタム開発
  • 教育
  • 会計事務所一覧
  • パートナー一覧
  • パートナーになる
企業情報
  • 会社概要
  • ブランドアセット
  • お問い合わせ
  • 採用情報
  • イベント
  • ポッドキャスト
  • ブログ
  • お客様一覧
  • リーガル情報 • プライバシーポリシー
  • セキュリティ
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk Slovenščina Español (América Latina) Español Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo(オドゥー)は、CRM、eコマース、会計、在庫管理、POS、プロジェクト管理など、企業のさまざまな業務を一つのシステムで管理できる、ベルギー発のオープンソースのERPソフトウェアです。

高機能で使いやすく、完全に統合されたERPとして、ユニークな価値を提供しています。

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now