Updating a bit for this original question for Odoo 13. The issue is still present and can easily cause total e-mail template rendering failing if one evaluation fails. We ran into this when modifying Spanish language version of the offer e-mail template. A typical use case is to check if a field has content or not before printing it out to the e-mail template as fields without any content set to them evaluate as text "False".
In our case we wanted to print tittle of the recipient if he has one ("Dear doctor Stephen Strange" if Stephen Strange has tittle defined). The field is object.partner_id.title.name and to check if it is filled, the code is following:
% if object.partner_id.title.name:
${object.partner_id.title.name}
% endif
So the whole block becomes:
<div style="font-size:13px;font-family:"Lucida Grande", Helvetica, Verdana, Arial, sans-serif;margin:0px;padding: 0px;">
<p style="margin:15px;font-size:13px;font-family:"Lucida Grande", Helvetica, Verdana, Arial, sans-serif;padding: 2px; font-size: 13px;">
% set doc_name = 'oferta' if object.state in ('draft', 'sent') else 'orden'
Estimado
% if object.partner_id.title.name:
${object.partner_id.title.name}
% endif
${object.partner_id.name},
<br><br>
Su
% if ctx.get('proforma'):
Pro forma factura ${doc_name} <strong style="font-weight:bolder;">${object.name}</strong>
% if object.origin:
(with reference: ${object.origin} )
% endif
con el precio total de <strong style="font-weight:bolder;">${format_amount(object.amount_total, object.pricelist_id.currency_id)}</strong> está disponible.
% else:
${doc_name} <strong style="font-weight:bolder;">${object.name}</strong>
% if object.origin:
(with reference: ${object.origin} )
% endif
con el precio total de <strong style="font-weight:bolder;">${format_amount(object.amount_total, object.pricelist_id.currency_id)}</strong> está listo para su revisión.
% endif
<br><br>
No dude en contactarnos si tiene alguna pregunta.
<br><br></p>
<p style="margin:15px;font-size:10px;font-family:"Lucida Grande", Helvetica, Verdana, Arial, sans-serif;padding: 2px; font-size: 8px;">
Términos y condiciones generales: ...Terms and conditions here...
</p>
</div>