Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

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

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

How to fix Mail Template

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
errormailtemplateHTML/CSS
2 Risposte
5540 Visualizzazioni
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
Abbandona
Ermin Trevisan

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

Moritz Ocker
Autore

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?

Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Post correlati Risposte Visualizzazioni Attività
?"Your country might be blocked by our hosting provider" error when I create new website
error
Avatar
0
ott 25
576
Payment Page Return Error with Razorpay on Mobile Devices
error
Avatar
0
set 25
1174
Error after installing "purchase" app in Odoo version 18
error
Avatar
Avatar
1
dic 24
6677
error schema for TourStep Error
error
Avatar
0
nov 24
2571
Can't modify manifest version of custom module [Odoo.sh]
error
Avatar
Avatar
Avatar
2
lug 24
5207
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة 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 è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

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