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
2017-04-01 10:41:52 +02:00
parent bde958f471
commit a7b70342d1
+4 -1
View File
@@ -64,4 +64,7 @@ class ConfigurationProductionSequence(ModelSQL, CompanyValueMixin):
def default_production_sequence(cls):
pool = Pool()
ModelData = pool.get('ir.model.data')
return ModelData.get_id('production', 'sequence_production')
try:
return ModelData.get_id('production', 'sequence_production')
except KeyError:
return None