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:
+4
-1
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user