From b1ef005a5d1fac8d23b90056350222bb04bc1883 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Tue, 29 Jun 2021 11:59:30 +0200 Subject: [PATCH] Test if contact is set before reading it's language issue10516 review352181002 (grafted from b4aaf747da380f142c8ab2bd1fc686138280c229) --HG-- branch : 6.0 --- ir.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ir.py b/ir.py index bbf516ff49..3196ae5ff4 100644 --- a/ir.py +++ b/ir.py @@ -79,7 +79,7 @@ class EmailTemplate(metaclass=PoolMeta): if isinstance(record, Party): usage = Transaction().context.get('usage') contact = record.contact_mechanism_get('email', usage=usage) - if contact.language: + if contact and contact.language: language = contact.language elif record.lang: language = record.lang