diff --git a/bt5/erp5_egov/DocumentTemplateItem/EGovTypeInformation.py b/bt5/erp5_egov/DocumentTemplateItem/EGovTypeInformation.py index 9a451897eaa23bbd87b9972c09f317b371d7592d..7323572e11219f88964833c9de46982ac6423e53 100644 --- a/bt5/erp5_egov/DocumentTemplateItem/EGovTypeInformation.py +++ b/bt5/erp5_egov/DocumentTemplateItem/EGovTypeInformation.py @@ -29,7 +29,7 @@ from Globals import InitializeClass from AccessControl import ClassSecurityInfo from Products.CMFCore.utils import getToolByName from Products.ERP5Type import Permissions, PropertySheet, Constraint -from Products.ERP5Type.Document.PDFTypeInformation import PDFTypeInformation +from Products.ERP5.Document.PDFTypeInformation import PDFTypeInformation from Products.ERP5Type.Core.ActionInformation import CacheableAction #line count in pdf form of procedure hosting request diff --git a/bt5/erp5_egov/ExtensionTemplateItem/SetUpEGovInstance.py b/bt5/erp5_egov/ExtensionTemplateItem/SetUpEGovInstance.py index 6f1ec9de267f2a26f5227f6bb7580f6c3167a83a..275e232e8b87d3b4cc600f81807c9600c1954d97 100644 --- a/bt5/erp5_egov/ExtensionTemplateItem/SetUpEGovInstance.py +++ b/bt5/erp5_egov/ExtensionTemplateItem/SetUpEGovInstance.py @@ -52,16 +52,10 @@ def allowAccessOnContributionRegistryPortalTypes(self): def allowAccessOnPersonAndOrganisation(self): '''Add local role on person and organisation to give administrative agent access. - ''' - - self.portal = self.getPortalObject() - person_portal_type = self.portal.portal_types.getTypeInfo('Person') - person_module_portal_type = self.portal.portal_types.getTypeInfo('Person Module') - organisation_portal_type = self.portal.portal_types.getTypeInfo('Organisation') - organisation_module_portal_type = self.portal.portal_types.getTypeInfo('Organisation Module') + ''' + portal_type_list = map(self.getPortalObject().portal_types.getTypeInfo, + ('Person', 'Person Module', 'Organisation', 'Organisation Module')) - portal_type_list = (person_portal_type, person_module_portal_type, organisation_portal_type, \ - organisation_module_portal_type) role_category_list = ['role/gouvernement'] for ptype in portal_type_list: role_info_list=[role_info.getTitle() for role_info in ptype.contentValues(portal_type='Role Information')] @@ -81,10 +75,8 @@ def enableEgovProcedureLogin(self, portal_type): and subcription forms (citizen, company, agent) ''' portal = self.getPortalObject() + acl_users = portal.acl_users - def getAclUsers(self): - return getattr(self.getPortalObject(), 'acl_users', None) - acl_users = getAclUsers(self) erp5security_dispatcher = acl_users.manage_addProduct['ERP5eGovSecurity'] # add the portal_type in Egov portal_type_list if {'meta_type': 'EGOV User Manager', 'id': 'egov_users'} in \ @@ -106,11 +98,7 @@ def setUpEGovSecurityManager(self): '''use safi PAS to be able to login organisation''' portal = self.getPortalObject() - - def getAclUsers(self): - return getattr(self.getPortalObject(), 'acl_users', None) - - acl_users = getAclUsers(self) + acl_users = portal.acl_users # Add EGOVUserManager ZopeTestCase.installProduct('ERP5eGovSecurity') diff --git a/bt5/erp5_egov/bt/revision b/bt5/erp5_egov/bt/revision index 45b1ccee2321964dc98e3f1141ca30e395bfff9f..6dca33d41f092e39af58b262a1918435937931dd 100644 --- a/bt5/erp5_egov/bt/revision +++ b/bt5/erp5_egov/bt/revision @@ -1 +1 @@ -741 \ No newline at end of file +742 \ No newline at end of file diff --git a/product/ERP5Type/Utils.py b/product/ERP5Type/Utils.py index 2667dcc449f61e972e85f3a2e8908e7e71cf4318..27f46aea83955eace7d86917424b9d617eab42b6 100644 --- a/product/ERP5Type/Utils.py +++ b/product/ERP5Type/Utils.py @@ -910,6 +910,7 @@ class PersistentMigrationMixin(object): # proceed with migration import erp5.portal_type klass = getattr(erp5.portal_type, portal_type) + assert self.__class__ != klass self.__class__ = klass self.__setstate__(value) LOG('ERP5Type', TRACE, "Migration for object %s" % self)