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
@@ -60,7 +60,10 @@ class ConfigurationAssetSequence(ModelSQL, CompanyValueMixin):
|
||||
def default_asset_sequence(cls):
|
||||
pool = Pool()
|
||||
ModelData = pool.get('ir.model.data')
|
||||
return ModelData.get_id('account_asset', 'sequence_asset')
|
||||
try:
|
||||
return ModelData.get_id('account_asset', 'sequence_asset')
|
||||
except KeyError:
|
||||
return None
|
||||
|
||||
|
||||
class Move:
|
||||
|
||||
Reference in New Issue
Block a user