Commit ecab29d9 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 d08d6c4f
...@@ -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
...@@ -246,6 +247,17 @@ class FolderMixIn(ExtensionClass.Base): ...@@ -246,6 +247,17 @@ class FolderMixIn(ExtensionClass.Base):
my_id = self._generateRandomId() my_id = self._generateRandomId()
return "%s.%03d-%s" %(current_date, node_number, my_id) return "%s.%03d-%s" %(current_date, node_number, my_id)
# 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