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:
+5
-2
@@ -66,8 +66,11 @@ class ConfigurationLandedCostSequence(ModelSQL, CompanyValueMixin):
|
||||
def default_landed_cost_sequence(cls):
|
||||
pool = Pool()
|
||||
ModelData = pool.get('ir.model.data')
|
||||
return ModelData.get_id(
|
||||
'account_stock_landed_cost', 'sequence_landed_cost')
|
||||
try:
|
||||
return ModelData.get_id(
|
||||
'account_stock_landed_cost', 'sequence_landed_cost')
|
||||
except KeyError:
|
||||
return None
|
||||
|
||||
|
||||
class LandedCost(Workflow, ModelSQL, ModelView):
|
||||
|
||||
Reference in New Issue
Block a user