Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

Display a text field in a mail template.

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
mailfieldstemplatetext
8862 Vues
Avatar
Yannick Gerard

Hello,

I created a mail template to explain to an employee why his leave was refused, but,when the mail is sent ...there is no explanation in it.

Here's my field, which is not empty (fill with a default function):

'refusal_explanation': fields.text('Refusal Explanation'), 

and here's my template:

<record id="email_template_conge_refused" model="email.template">
<field name="name">leave state - Refused</field>
<field name="email_from">openerp@cesbron.com</field>
<field name="subject">[what you asked] - Refused</field>
<field name="email_to">${object.employee_id.work_email}</field>
<field name="auto_delete" eval="True"/>
<field name="model_id" ref="cesbron_hr13.model_hr_holidays"/>
<field name="body_html"><![CDATA[
<p>Hello</p>
<p> Your leave from ${object.date_from} to ${object.date_to} was modified by your superior.</p>
<p> The state is now "REFUSED"!!</p>
 
<p>Explanation: ${object.refusal_explanation}</p>

<p>best regards,</p>
<p>${object.employee_id.parent_id.name}</p>
]]></field>
</record>

I know there is something in refusal_explanation, "you didn"t say please", but the result is:

Hello

your leave from .............

the state is now "REFUSED!!"

explanation:                          <= and here should be write "you didn't say please"

best regards

some name.


My field is in the current object and is not empty that's why i don't understand why it doesn't apear in the mail ( I tried with a fields.char too....didn't work)

Someone can explain me why or what can I do to resolve my problem ?


0
Avatar
Ignorer
Akhil P Sivan

You have added the field to hr.holidays model right? Have you checked without default function? I mean by entering some text manually? May be problem with default function.

Yannick Gerard
Auteur

Yeah I tried manually too, and I have the same result. I can see my field content in the view, but not in the mail ...

Atchuthan - Technical Consultant, Sodexis Inc

If you are trying to set a template for employee holiday table, then the model used is wrong. ()

Atchuthan - Technical Consultant, Sodexis Inc

hr_holidays.model_hr_holidays

Atchuthan - Technical Consultant, Sodexis Inc

Go to Settings --> Technical --> Email --> Template, Open your record, and check your value with Dynamic value builder and Preview in it.

Yannick Gerard
Auteur

No it's the right model ... thanks to your advices, it seems to be an other issue...the line "explanation:${object.refusal_explanation}" doesn't want to be added to my template ... so i deleted all my templates and re-update them ...and it still don't work >.

Yannick Gerard
Auteur

OK i found my problem ...there was a "noupdate="1" "at the start of my file ... that's why the update wasn't done... how did i Miss that thing ...

Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
Force sender email for all platform mails Résolu
mail template
Avatar
Avatar
Avatar
Avatar
Avatar
8
juil. 24
24864
Changing Position of Email: Customer Adress on Sale/Invoice
mail template
Avatar
Avatar
1
sept. 21
4580
Bounce address when sending some mail from mail.template
mail template
Avatar
0
nov. 20
4225
How to create email template using python
mail template
Avatar
Avatar
Avatar
Avatar
Avatar
7
sept. 19
36788
Cannot save e-mail templates
mail template
Avatar
Avatar
1
mars 15
7519
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 ภาษาไทย Türkçe українська Tiếng Việt

Odoo est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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