Catch KeyError on ModelData.get_id in default method

Since changeset 685f2d888dca, the default methods are always called in
__register__ when the XML files are not yet loaded.

issue6409
This commit is contained in:
Cédric Krier committed 2017-04-01 10:43:00 +02:00
1 parent 766573ca15
commit 500a23ccc1
1 file changed
+5 -2
+5 -2
View File
@@ -68,5 +68,8 @@ class ConfigurationSequence:
def default_sale_opportunity_sequence(cls):
pool = Pool()
ModelData = pool.get('ir.model.data')
return ModelData.get_id(
'sale_opportunity', 'sequence_sale_opportunity')
try:
return ModelData.get_id(
'sale_opportunity', 'sequence_sale_opportunity')
except KeyError:
return None