Przejdź do zawartości
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Sztuczna inteligencja
    • IoT
    • VoIP
    • Wiedza
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

Available variables in email templates

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
qwebemailtemplatearray
1 Odpowiedz
780 Widoki
Awatar
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
Awatar
Odrzuć
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.

Awatar
Javier Garcia
Najlepsza odpowiedź

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
Awatar
Odrzuć
Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
Add dynamic email reply to link email odoo v16
qweb emailtemplate V16
Awatar
0
sie 24
2555
t-att-href button not rendered in outlook
qweb emailtemplate email_template
Awatar
Awatar
1
mar 23
4795
How to make a email with the orderd products in the body (qweb or jinja2)
qweb emailtemplate jinja2 odoo10
Awatar
2
sie 18
4946
Use QWeb Rendering Engine in Odoo 9 for E-Mail Templates
qweb mass_mailing emailtemplate odoo9
Awatar
Awatar
1
gru 17
7124
Odoo 18: Display image from char field containing url in qweb form
qweb
Awatar
Awatar
1
lip 25
4956
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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