From f48ef451e58eaaf6687fded32ec5ed3f5a1367a5 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Fri, 20 Oct 2017 14:57:37 +0200 Subject: [PATCH] Catch KeyError on email_template default value When installing the module on a database with existing procedures, trytond tries to set the value for existing columns but it fails as the default report template is not yet loaded on the database issue6866 review39831002 --- account.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/account.py b/account.py index d52aafea7c..07ba1c260f 100644 --- a/account.py +++ b/account.py @@ -42,7 +42,10 @@ class DunningLevel: def default_email_template(cls): pool = Pool() Data = pool.get('ir.model.data') - return Data.get_id('account_dunning_email', 'report_email') + try: + return Data.get_id('account_dunning_email', 'report_email') + except KeyError: + return class ProcessDunning: