Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Guest House
    • Drankenhandelaar
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Solar Energy Systems
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC Services
    Others
    • Nonprofit Organization
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

Email template is failed to render ? [SOLVED]

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
v8sale.orderemail_template
4 Antwoorden
33097 Weergaven
Avatar
YOPI ANGI

Hello,

I define new process that will send the email automatically without through the wizard. 

I create new template (adapt from existing one), but when i send it, i check the email and the email i got is not supposed to be, the email is weird.

from the server is trace the log, they look like this:

 MissingError: ('MissingError', 'One of the documents you are trying to access has been deleted, please try again after refreshing.')
2015-02-17 05:44:08,316 1100 ERROR tes06 openerp.addons.email_template.email_template: Failed to render template <Template memory:7f76f8117bd0> using values {'format_tz': <function <lambda> at 0x7f76e8b8bc08>, 'ctx': {'default_use_template': True, 'lang': None, 'default_composition_mode': 'comment', 'default_template_id': 31, 'default_res_id': 56, 'mark_so_as_sent': True, 'default_model': 'sale.order', 'tpl_partners_only': True}, 'user': res.users(1,), 'object': account.invoice(56,)}

the email i got, is like this:

Hello ${object.partner_id.name},

We want to say thank you for your trusted to us.

Here the information about your sale order,

  REFERENCES
  Invoice number: ${object.number}
  Invoice total: ${object.amount_total} ${object.currency_id.name}
  Invoice date: ${object.date_invoice}
% if object.origin:   Order reference: ${object.origin}
% endif % if object.user_id:   Your contact: ${object.user_id.name} % endif

 

here my code:

@api.one

def action_mail_send(self):

mail_compose = self.env['mail.compose.message']

# get the template

template_id = self.so_paid_email_template()

# modify the context

ctx = dict()

ctx.update({ 'default_model': 'sale.order', 'default_res_id': self.ids[0], 'default_use_template': bool(template_id), 'default_template_id': template_id.id, 'default_composition_mode': 'comment', 'mark_so_as_sent': True, })

# compose message

new_message = mail_compose.with_context(ctx).create({ 'partner_ids': self.partner_id.email, 'body': template_id.body_html, })

# send

new_message.send_mail()

return True

 

Thank You,

0
Avatar
Annuleer
Avatar
YOPI ANGI
Auteur Beste antwoord

I think i solved it. :)

it's a simple solution, just load the email template and then sent it

example: 

template_id = self.env.ref('model.xml_id')

template_id.send_mail(self.ids[0], force_send=True)

 

2
Avatar
Annuleer
Murugan Chinnasamy

This is working good

Avatar
Joe BALANGA
Beste antwoord

Salut!! Je suis en train de créer un devis mais à chaque fois qu'il faut valider mon devis, Odoo m'envoit un message en disant que la ligne n'est pas défini. Alors je ne sais pas comment faire!

L'erreur en question :  Failed to render template : 'line' is undefined

0
Avatar
Annuleer
Avatar
Ruturaj Chavda
Beste antwoord

Hi ,Create a new custom module and write the same code. It works.

0
Avatar
Annuleer
Avatar
krishnakanth
Beste antwoord

Hi, Try this solution once as follows: If your rendering datetime field value: here object.cutoff_date is datetime field ${format_tz(object.cutoff_date, format= '%d/%b/%Y')} If Date field as follows: here object.cutoff_date is date field ${format_tz(object.cutoff_date+ ' 00:00:00', format= '%d/%b/%Y')}

0
Avatar
Annuleer
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
How can I add custom fields to the sale order print template?
v8 print sale.order
Avatar
Avatar
Avatar
Avatar
3
apr. 22
13602
how to call email templates with a custom module Opgelost
v8 email_template selectable
Avatar
Avatar
Avatar
Avatar
4
nov. 19
14628
How to feeding a field with template by selecting a drop down list
v8 dropdownlist email_template
Avatar
0
nov. 18
5202
How to modify count total amount in sale order? [SOLVED] Opgelost
v8 sale.order override
Avatar
Avatar
Avatar
3
jan. 18
10021
is it possible to use QWeb template when define a email template?
v8 qweb email_template
Avatar
Avatar
1
sep. 16
4639
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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