Zum Inhalt springen
Odoo Menü
  • Anmelden
  • Jetzt gratis testen
  • Apps
    Finanzen
    • Buchhaltung
    • Rechnungsstellung
    • Spesenabrechnung
    • Tabellenkalkulation (BI)
    • Dokumente
    • E-Signatur
    Verkauf
    • CRM
    • Verkauf
    • Kassensystem – Shop
    • Kassensystem – Restaurant
    • Abonnements
    • Vermietung
    Websites
    • Website-Builder
    • E-Commerce
    • Blog
    • Forum
    • Livechat
    • E-Learning
    Lieferkette
    • Lager
    • Fertigung
    • PLM
    • Einkauf
    • Wartung
    • Qualität
    Personalwesen
    • Mitarbeiter
    • Personalbeschaffung
    • Abwesenheiten
    • Mitarbeiterbeurteilung
    • Personalempfehlungen
    • Fuhrpark
    Marketing
    • Social Marketing
    • E-Mail-Marketing
    • SMS-Marketing
    • Veranstaltungen
    • Marketing-Automatisierung
    • Umfragen
    Dienstleistungen
    • Projekte
    • Zeiterfassung
    • Außendienst
    • Kundendienst
    • Planung
    • Termine
    Produktivität
    • Dialog
    • Künstliche Intelligenz
    • IoT
    • VoIP
    • Wissensdatenbank
    • WhatsApp
    Apps von Drittanbietern Odoo Studio Odoo Cloud-Plattform
  • Branchen
    Einzelhandel
    • Buchladen
    • Kleidergeschäft
    • Möbelhaus
    • Lebensmittelgeschäft
    • Baumarkt
    • Spielwarengeschäft
    Essen & Gastgewerbe
    • Bar und Kneipe
    • Restaurant
    • Fast Food
    • Gästehaus
    • Getränkehändler
    • Hotel
    Immobilien
    • Immobilienagentur
    • Architekturbüro
    • Baugewerbe
    • Immobilienverwaltung
    • Gartenarbeit
    • Eigentümervereinigung
    Beratung
    • Buchhaltungsfirma
    • Odoo-Partner
    • Marketingagentur
    • Anwaltskanzlei
    • Talentakquise
    • Prüfung & Zertifizierung
    Fertigung
    • Textil
    • Metall
    • Möbel
    • Speisen
    • Brauerei
    • Firmengeschenke
    Gesundheit & Fitness
    • Sportklub
    • Brillengeschäft
    • Fitnessstudio
    • Therapeut
    • Apotheke
    • Friseursalon
    Handel
    • Handyman
    • IT-Hardware & -Support
    • Solarenergiesysteme
    • Schuster
    • Reinigungsdienstleistungen
    • HLK-Dienstleistungen
    Sonstiges
    • Gemeinnützige Organisation
    • Umweltschutzagentur
    • Plakatwandvermietung
    • Fotostudio
    • Fahrrad-Leasing
    • Software-Händler
    Alle Branchen ansehen
  • Community
    Lernen
    • Tutorials
    • Dokumentation
    • Zertifizierungen
    • Schulung
    • Blog
    • Podcast
    Bildung fördern
    • Bildungsprogramm
    • Scale-Up! Planspiel
    • Odoo besuchen
    Software anfragen
    • Herunterladen
    • Editionen vergleichen
    • Releases
    Zusammenarbeiten
    • Github
    • Forum
    • Veranstaltungen
    • Übersetzungen
    • Partner werden
    • Dienstleistungen für Partner
    • Buchhaltungsfirma registrieren
    Services anfragen
    • Partner finden
    • Buchhalter finden
    • Einen Experten treffen
    • Implementierungsservices
    • Kundenreferenzen
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Eine Demo erhalten
  • Preise
  • Hilfe
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Hilfe

Available variables in email templates

Abonnieren

Erhalten Sie eine Benachrichtigung, wenn es eine Aktivität zu diesem Beitrag gibt

Diese Frage wurde gekennzeichnet
qwebemailtemplatearray
1 Antworten
782 Ansichten
Avatar
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
Avatar
Verwerfen
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
Autor

@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
Autor

@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
Autor

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

Avatar
Javier Garcia
Beste Antwort

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
Avatar
Verwerfen
Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!

Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!

Registrieren
Verknüpfte Beiträge Antworten Ansichten Aktivität
Add dynamic email reply to link email odoo v16
qweb emailtemplate V16
Avatar
0
Aug. 24
2563
t-att-href button not rendered in outlook
qweb emailtemplate email_template
Avatar
Avatar
1
März 23
4799
How to make a email with the orderd products in the body (qweb or jinja2)
qweb emailtemplate jinja2 odoo10
Avatar
2
Aug. 18
4950
Use QWeb Rendering Engine in Odoo 9 for E-Mail Templates
qweb mass_mailing emailtemplate odoo9
Avatar
Avatar
1
Dez. 17
7125
Odoo 18: Display image from char field containing url in qweb form
qweb
Avatar
Avatar
1
Juli 25
4974
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Herunterladen
  • Github
  • Runbot
  • Übersetzungen
Dienstleistungen
  • Odoo.sh-Hosting
  • Support
  • Upgrade
  • Individuelle Entwicklungen
  • Bildung
  • Buchhalter finden
  • Partner finden
  • Partner werden
Über uns
  • Unsere Firma
  • Markenwerte
  • Kontakt
  • Karriere
  • Veranstaltungen
  • Podcast
  • Blog
  • Kunden
  • Rechtliches • Datenschutz
  • Sicherheit
الْعَرَبيّة 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 ist eine Suite von Open-Source-Betriebsanwendungen, die alle Bedürfnisse Ihres Unternehmens abdecken: CRM, E-Commerce, Buchhaltung, Lager, Kassensystem, Projektmanagement etc.

Das einzigartige Wertversprechen von Odoo ist, dass es gleichzeitig sehr einfach zu bedienen und voll integriert ist.

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