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
This commit is contained in:
Sergi Almacellas Abellana
2017-10-20 14:57:37 +02:00
parent d3e712caf9
commit f48ef451e5
+4 -1
View File
@@ -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: