Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

How to fix Mail Template

Subscriure's

Get notified when there's activity on this post

This question has been flagged
errormailtemplateHTML/CSS
2 Respostes
5543 Vistes
Avatar
Moritz Ocker

My Sale Confirmation Mail Template ist not working. I do get this error:


Fehler beim Erstellen der Vorlage <Template memory:7fb4f60dca58> mit den Werten {'format_date': <function MailTemplate._render_template.<locals>.<lambda> at 0x7fb4f6487840>, 'format_datetime': <function MailTemplate._render_template.<locals>.<lambda> at 0x7fb4f6487ea0>, 'format_amount': <function MailTemplate._render_template.<locals>.<lambda> at 0x7fb503bbdbf8>, 'format_duration': <function MailTemplate._render_template.<locals>.<lambda> at 0x7fb503bbdea0>, 'user': res.users(9,), 'ctx': {'lang': 'de_DE', 'tz': 'Europe/Berlin', 'uid': 9, 'allowed_company_ids': [1], 'template_id': 45, 'active_model': 'mail.template', 'active_id': 45, 'active_ids': [45], 'template_preview_lang': 'de_DE', 'safe': False}, 'object': sale.order(117,)} UndefinedError: 'loop' is undefined

How can I fix my template?


Thank you

0
Avatar
Descartar
Ermin Trevisan

Please provide the necessary information (log entries, template code ...)

Moritz Ocker
Autor

My template code is:

<div style="font-size:13px;font-family:&quot;Lucida Grande&quot;, Helvetica, Verdana, Arial, sans-serif;margin:0px;padding: 0px;">

<p style="margin:0px;font-size:13px;font-family:&quot;Lucida Grande&quot;, Helvetica, Verdana, Arial, sans-serif;padding: 0px; font-size: 12px;">

Hallo,

<br><br>

% set transaction = object.get_portal_last_transaction()

Ihre Bestellung <strong style="font-weight:bolder;">${object.name}</strong> amounting in <strong style="font-weight:bolder;">${format_amount(object.amount_total, object.currency_id)}</strong>

% if object.state == 'sale' or (transaction and transaction.state in ('done', 'authorized')) :

wurde bestätigt.<br>

Vielen Dank für Ihr Vertrauen!

% elif transaction and transaction.state == 'pending' :

steht aus. Diese wird bestätigt, sobald die Zahlung eingegangen ist.

% if object.reference:

Ihre Zahlungsreferenz ist <strong style="font-weight:bolder;">${object.reference}</strong>.

% endif

% endif

<br><br>

Zögern Sie nicht, uns zu kontaktieren, wenn Sie Fragen haben.

<br><br>

% if object.website_id:

</p>

% for line in object.order_line:

% if not line.is_delivery:

% if line.display_type == 'line_section':

% elif line.display_type == 'line_note':

% else:

% if object.user_id.has_group('account.group_show_line_subtotals_tax_excluded'):

% endif

% if object.user_id.has_group('account.group_show_line_subtotals_tax_included'):

% endif

% endif

% endif

% endfor

<table width="100%" style="border-collapse:collapse;color:#454748;font-size: 12px; border-collapse: collapse;">

<tbody><tr style="border-bottom:2px solid #dee2e6;">

<td width="18%"><strong style="font-weight:bolder;">Produkt</strong></td>

<td>&nbsp;</td>

<td><strong style="font-weight:bolder;">Menge</strong></td>

<td width="10%" align="center"><strong style="font-weight:bolder;">Preis</strong></td>

</tr><tr style="${loop.cycle('background-color:#f2f2f2', 'background-color: #ffffff')}"><td colspan="4"><strong style="font-weight:bolder;">${line.name}</strong></td><td colspan="4"><i>${line.name}</i></td><td style="width:150px;">

<img src="/web/image/product.product/${line.product_id.id}/image_128" style="border-style:none;vertical-align:middle;width:64px;height: 64px; object-fit: contain;" alt="Product image">

</td>

<td align="left">${line.product_id.name}</td>

<td>${line.product_uom_qty}</td><td align="right">${format_amount(line.price_reduce_taxexcl, object.currency_id)}</td><td align="right">${format_amount(line.price_reduce_taxinc, object.currency_id)}</td></tr></tbody></table>

% if object.carrier_id:

% else:

% endif

<table width="40%" style="border-collapse:collapse;color:#454748;font-size: 12px; border-spacing: 0px 4px;" align="right"><tbody><tr>

<td style="border-top:1px solid #dee2e6;" align="right"><strong style="font-weight:bolder;">Lieferdatum:</strong></td>

<td style="border-top:1px solid #dee2e6;" align="right">${format_amount(object.amount_delivery, object.currency_id)}</td>

</tr>

<tr>

<td width="30%" align="right"><strong style="font-weight:bolder;">Zwischensumme:</strong></td>

<td align="right">${format_amount(object.amount_untaxed, object.currency_id)}</td>

</tr><tr>

<td style="border-top:1px solid #dee2e6;" width="30%" align="right"><strong style="font-weight:bolder;">Zwischensumme:</strong></td>

<td style="border-top:1px solid #dee2e6;" align="right">${format_amount(object.amount_untaxed, object.currency_id)}</td>

</tr><tr>

<td align="right"><strong style="font-weight:bolder;">Mehrwertsteuer:</strong></td>

<td align="right">${format_amount(object.amount_tax, object.currency_id)}</td>

</tr>

<tr>

<td style="border-top:1px solid #dee2e6;" align="right"><strong style="font-weight:bolder;">Gesamtsumme:</strong></td>

<td style="border-top:1px solid #dee2e6;" align="right">${format_amount(object.amount_total, object.currency_id)}</td>

</tr>

</tbody></table>

<br>

% if object.partner_invoice_id:

% endif

% if object.partner_shipping_id and not object.only_services:

% if object.carrier_id:

% endif

% endif

<table width="100%" style="border-collapse:collapse;color:#454748;font-size: 12px;"><tbody><tr>

<td style="padding-top:10px;">

<strong style="font-weight:bolder;">Rechnung an:</strong>

${object.partner_invoice_id.street or ''}

${object.partner_invoice_id.city or ''}

${object.partner_invoice_id.state_id.name or ''}

${object.partner_invoice_id.zip or ''}

${object.partner_invoice_id.country_id.name or ''}

</td>

</tr>

<tr>

<td>

<strong style="font-weight:bolder;">Bezahlungsmethode:</strong>

% if transaction.payment_token_id:

${transaction.payment_token_id.name}

% else:

${transaction.acquirer_id.name}

% endif

(${format_amount(transaction.amount, object.currency_id)})

</td>

</tr><tr>

<td>

<br>

<strong style="font-weight:bolder;">Lieferung an:</strong>

${object.partner_shipping_id.street or ''}

${object.partner_shipping_id.city or ''}

${object.partner_shipping_id.state_id.name or ''}

${object.partner_shipping_id.zip or ''}

${object.partner_shipping_id.country_id.name or ''}

</td>

</tr><tr>

<td>

<strong style="font-weight:bolder;">Liefermethode:</strong>

${object.carrier_id.name}

% if object.carrier_id.fixed_price == 0.0:

(Free)

% else:

(${format_amount(object.carrier_id.fixed_price, object.currency_id)})

% endif

</td>

</tr></tbody></table>

% endif

<p style="margin:0px;font-size:13px;font-family:&quot;Lucida Grande&quot;, Helvetica, Verdana, Arial, sans-serif;"></p>

</div>

Where can I find the other necessary information?

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
?"Your country might be blocked by our hosting provider" error when I create new website
error
Avatar
0
d’oct. 25
576
Payment Page Return Error with Razorpay on Mobile Devices
error
Avatar
0
de set. 25
1175
Error after installing "purchase" app in Odoo version 18
error
Avatar
Avatar
1
de des. 24
6687
error schema for TourStep Error
error
Avatar
0
de nov. 24
2571
Can't modify manifest version of custom module [Odoo.sh]
error
Avatar
Avatar
Avatar
2
de jul. 24
5216
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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