Commit 60ab44fb authored by Arnaud Fontaine's avatar Arnaud Fontaine

Automatic migration to ZODB Property Sheets failed because of Folder

generateNewId() calling getIdGenerator() accessor which not available yet,
thus define a dummy accessor so that erp5_property_sheets can be installed.
parent a5f3ed7b
...@@ -46,6 +46,7 @@ from Products.ERP5Type.XMLExportImport import Folder_asXML ...@@ -46,6 +46,7 @@ from Products.ERP5Type.XMLExportImport import Folder_asXML
from Products.ERP5Type.Utils import sortValueList from Products.ERP5Type.Utils import sortValueList
from Products.ERP5Type import Permissions from Products.ERP5Type import Permissions
from Products.ERP5Type.Globals import InitializeClass from Products.ERP5Type.Globals import InitializeClass
from Products.ERP5Type.Accessor import Base as BaseAccessor
try: try:
from Products.CMFCore.CMFBTreeFolder import CMFBTreeFolder from Products.CMFCore.CMFBTreeFolder import CMFBTreeFolder
...@@ -228,6 +229,17 @@ class FolderMixIn(ExtensionClass.Base): ...@@ -228,6 +229,17 @@ class FolderMixIn(ExtensionClass.Base):
node_number = 111 node_number = 111
return "%03d-%s" %(node_number, self._generateRandomId()) return "%03d-%s" %(node_number, self._generateRandomId())
# Getter defines to address migration of a site to ZODB Property Sheets,
# otherwise installing erp5_property_sheets fails in generateNewId() as
# getIdGenerator accessor does not exist yet
getIdGenerator = BaseAccessor.Getter('getIdGenerator', 'id_generator',
'string', default='')
getLastId = BaseAccessor.Getter('getLastId', 'last_id', 'string',
default='0')
_setLastId = BaseAccessor.Setter('_setLastId', 'last_id', 'string')
# Automatic ID Generation method # Automatic ID Generation method
security.declareProtected(Permissions.View, 'generateNewId') security.declareProtected(Permissions.View, 'generateNewId')
def generateNewId(self,id_group=None,default=None,method=None): def generateNewId(self,id_group=None,default=None,method=None):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment