[FIX] purchase: wrong condition in mail template

Before checking the first element of
'partner_id.child_ids', rather check that
the partner and not the object has children,
to avoid crashes when the partner of the PO
is a company.
opw-1826359
This commit is contained in:
jem-odoo
2018-03-19 15:13:33 +00:00
parent 71f56fd2fa
commit 622b70ee3e
+1 -1
View File
@@ -15,7 +15,7 @@
<field name="lang">${object.partner_id.lang}</field> <field name="lang">${object.partner_id.lang}</field>
<field name="body_html"><![CDATA[ <field name="body_html"><![CDATA[
<p>Dear <p>Dear
% if object.partner_id.is_company and object.child_ids: % if object.partner_id.is_company and object.partner_id.child_ids:
${object.partner_id.child_ids[0].name} ${object.partner_id.child_ids[0].name}
% else : % else :
${object.partner_id.name} ${object.partner_id.name}