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