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:
1 parent
06329221fa
commit
e33409d4f5
1 file changed
+5
-2
+5
-2
@@ -90,8 +90,11 @@ class ConfigurationSequence:
|
||||
def default_purchase_requisition_sequence(cls):
|
||||
pool = Pool()
|
||||
ModelData = pool.get('ir.model.data')
|
||||
return ModelData.get_id(
|
||||
'purchase_requisition', 'sequence_purchase_requisition')
|
||||
try:
|
||||
return ModelData.get_id(
|
||||
'purchase_requisition', 'sequence_purchase_requisition')
|
||||
except KeyError:
|
||||
return None
|
||||
|
||||
|
||||
class PurchaseRequisition(Workflow, ModelSQL, ModelView):
|
||||
|
||||
Reference in new issue
Block a user