Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikola Balog
erp5
Commits
efa37474
Commit
efa37474
authored
Feb 15, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*: update imports to prevent deprecation warnings and prepare Zope5 compatibility
parent
b7daa4bf
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
29 additions
and
22 deletions
+29
-22
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testBusinessTemplate.py
...eItem/portal_components/test.erp5.testBusinessTemplate.py
+1
-1
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Core.py
...tTemplateItem/portal_components/test.erp5.testERP5Core.py
+1
-1
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testLocalizer.py
...TemplateItem/portal_components/test.erp5.testLocalizer.py
+2
-1
product/CMFActivity/ActivityTool.py
product/CMFActivity/ActivityTool.py
+1
-1
product/ERP5/Document/BusinessTemplate.py
product/ERP5/Document/BusinessTemplate.py
+1
-1
product/ERP5/ERP5Site.py
product/ERP5/ERP5Site.py
+1
-1
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.EmailDocument.py
...lateItem/portal_components/document.erp5.EmailDocument.py
+1
-1
product/ERP5Form/PDFTemplate.py
product/ERP5Form/PDFTemplate.py
+1
-1
product/ERP5OOo/FormPrintout.py
product/ERP5OOo/FormPrintout.py
+1
-1
product/ERP5OOo/OOoTemplate.py
product/ERP5OOo/OOoTemplate.py
+1
-1
product/ERP5Type/Permissions.py
product/ERP5Type/Permissions.py
+4
-5
product/ERP5Type/Utils.py
product/ERP5Type/Utils.py
+1
-1
product/ERP5Type/patches/BTreeFolder2.py
product/ERP5Type/patches/BTreeFolder2.py
+1
-1
product/ERP5Type/patches/DCWorkflow.py
product/ERP5Type/patches/DCWorkflow.py
+1
-1
product/ERP5Type/patches/PropertyManager.py
product/ERP5Type/patches/PropertyManager.py
+6
-1
product/ERP5Type/patches/sqltest.py
product/ERP5Type/patches/sqltest.py
+2
-0
product/ERP5Type/tests/ERP5TypeLiveTestCase.py
product/ERP5Type/tests/ERP5TypeLiveTestCase.py
+1
-1
product/ERP5Type/tests/ERP5TypeTestCase.py
product/ERP5Type/tests/ERP5TypeTestCase.py
+1
-1
product/PortalTransforms/TransformEngine.py
product/PortalTransforms/TransformEngine.py
+1
-1
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testBusinessTemplate.py
View file @
efa37474
...
@@ -50,7 +50,7 @@ from OFS.Image import Pdata
...
@@ -50,7 +50,7 @@ from OFS.Image import Pdata
WORKFLOW_TYPE
=
'erp5_workflow'
WORKFLOW_TYPE
=
'erp5_workflow'
from
Products.MimetypesRegistry.
common
import
MimeTypeException
from
Products.MimetypesRegistry.
interfaces
import
MimeTypeException
from
Products.PortalTransforms.Transform
import
Transform
from
Products.PortalTransforms.Transform
import
Transform
Transform_tr_init
=
Transform
.
_tr_init
Transform_tr_init
=
Transform
.
_tr_init
Transform_manage_beforeDelete
=
Transform
.
manage_beforeDelete
Transform_manage_beforeDelete
=
Transform
.
manage_beforeDelete
...
...
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Core.py
View file @
efa37474
...
@@ -576,7 +576,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
...
@@ -576,7 +576,7 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
0
!=
i
.
getUid
()
!=
i
.
getProperty
(
'uid'
)])
0
!=
i
.
getUid
()
!=
i
.
getProperty
(
'uid'
)])
def
test_04_site_manager_and_translation_migration
(
self
):
def
test_04_site_manager_and_translation_migration
(
self
):
from
zope.
site
.hooks
import
setSite
from
zope.
component
.hooks
import
setSite
from
zope.component
import
queryUtility
from
zope.component
import
queryUtility
# check translation is working normaly
# check translation is working normaly
erp5_ui_catalog
=
self
.
portal
.
Localizer
.
erp5_ui
erp5_ui_catalog
=
self
.
portal
.
Localizer
.
erp5_ui
...
...
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testLocalizer.py
View file @
efa37474
...
@@ -33,7 +33,8 @@ import six
...
@@ -33,7 +33,8 @@ import six
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Persistence
import
PersistentMapping
from
Persistence
import
PersistentMapping
from
zope.site.hooks
import
setSite
from
zope.component.hooks
import
setSite
class
TestLocalizer
(
ERP5TypeTestCase
):
class
TestLocalizer
(
ERP5TypeTestCase
):
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
...
...
product/CMFActivity/ActivityTool.py
View file @
efa37474
...
@@ -58,7 +58,7 @@ from BTrees.OIBTree import OIBTree
...
@@ -58,7 +58,7 @@ from BTrees.OIBTree import OIBTree
from
BTrees.OOBTree
import
OOBTree
from
BTrees.OOBTree
import
OOBTree
from
Zope2
import
app
from
Zope2
import
app
from
Products.ERP5Type.UnrestrictedMethod
import
PrivilegedUser
from
Products.ERP5Type.UnrestrictedMethod
import
PrivilegedUser
from
zope.
site
.hooks
import
setSite
from
zope.
component
.hooks
import
setSite
import
transaction
import
transaction
from
App.config
import
getConfiguration
from
App.config
import
getConfiguration
from
Shared.DC.ZRDB.Results
import
Results
from
Shared.DC.ZRDB.Results
import
Results
...
...
product/ERP5/Document/BusinessTemplate.py
View file @
efa37474
...
@@ -111,7 +111,7 @@ try:
...
@@ -111,7 +111,7 @@ try:
except
TypeError
:
except
TypeError
:
pass
pass
cache_database
=
threading
.
local
()
cache_database
=
threading
.
local
()
from
Products.MimetypesRegistry.
common
import
MimeTypeException
from
Products.MimetypesRegistry.
interfaces
import
MimeTypeException
import
imghdr
import
imghdr
# those attributes from CatalogMethodTemplateItem are kept for
# those attributes from CatalogMethodTemplateItem are kept for
...
...
product/ERP5/ERP5Site.py
View file @
efa37474
...
@@ -478,7 +478,7 @@ class ERP5Site(ResponseHeaderGenerator, FolderMixIn, PortalObjectBase, CacheCook
...
@@ -478,7 +478,7 @@ class ERP5Site(ResponseHeaderGenerator, FolderMixIn, PortalObjectBase, CacheCook
# one. Including setting up ZTK style utilities and adapters. We
# one. Including setting up ZTK style utilities and adapters. We
# can even call setSite(self), as long as we roll back that later,
# can even call setSite(self), as long as we roll back that later,
# since we are actually in the middle of a setSite() call.
# since we are actually in the middle of a setSite() call.
from
zope.
site
.hooks
import
getSite
,
setSite
from
zope.
component
.hooks
import
getSite
,
setSite
old_site
=
getSite
()
old_site
=
getSite
()
try
:
try
:
setSite
(
self
)
setSite
(
self
)
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.EmailDocument.py
View file @
efa37474
...
@@ -39,7 +39,7 @@ from erp5.component.mixin.DocumentProxyMixin import DocumentProxyMixin, Document
...
@@ -39,7 +39,7 @@ from erp5.component.mixin.DocumentProxyMixin import DocumentProxyMixin, Document
from
MethodObject
import
Method
from
MethodObject
import
Method
try
:
try
:
from
Products.MimetypesRegistry.
common
import
MimeTypeException
# pylint: disable=unused-import
from
Products.MimetypesRegistry.
interfaces
import
MimeTypeException
# pylint: disable=unused-import
except
ImportError
:
except
ImportError
:
class
MimeTypeException
(
Exception
):
class
MimeTypeException
(
Exception
):
"""
"""
...
...
product/ERP5Form/PDFTemplate.py
View file @
efa37474
...
@@ -46,7 +46,7 @@ from Products.ERP5Type.Utils import UpperCase
...
@@ -46,7 +46,7 @@ from Products.ERP5Type.Utils import UpperCase
from
zLOG
import
LOG
from
zLOG
import
LOG
try
:
try
:
from
webdav.Lockable
import
ResourceLockedError
from
zExceptions
import
ResourceLockedError
from
webdav.WriteLockInterface
import
WriteLockInterface
from
webdav.WriteLockInterface
import
WriteLockInterface
SUPPORTS_WEBDAV_LOCKS
=
1
SUPPORTS_WEBDAV_LOCKS
=
1
except
ImportError
:
except
ImportError
:
...
...
product/ERP5OOo/FormPrintout.py
View file @
efa37474
...
@@ -53,7 +53,7 @@ import re
...
@@ -53,7 +53,7 @@ import re
import
six
import
six
try
:
try
:
from
webdav.Lockable
import
ResourceLockedError
from
zExceptions
import
ResourceLockedError
SUPPORTS_WEBDAV_LOCKS
=
1
SUPPORTS_WEBDAV_LOCKS
=
1
except
ImportError
:
except
ImportError
:
SUPPORTS_WEBDAV_LOCKS
=
0
SUPPORTS_WEBDAV_LOCKS
=
0
...
...
product/ERP5OOo/OOoTemplate.py
View file @
efa37474
...
@@ -50,7 +50,7 @@ import itertools
...
@@ -50,7 +50,7 @@ import itertools
import
six
import
six
try
:
try
:
from
webdav.Lockable
import
ResourceLockedError
from
zExceptions
import
ResourceLockedError
from
webdav.WriteLockInterface
import
WriteLockInterface
from
webdav.WriteLockInterface
import
WriteLockInterface
SUPPORTS_WEBDAV_LOCKS
=
1
SUPPORTS_WEBDAV_LOCKS
=
1
except
ImportError
:
except
ImportError
:
...
...
product/ERP5Type/Permissions.py
View file @
efa37474
...
@@ -38,8 +38,7 @@ http://dev.zope.org/Wikis/DevSite/Projects/DeclarativeSecurity/ZopeSecurityForDe
...
@@ -38,8 +38,7 @@ http://dev.zope.org/Wikis/DevSite/Projects/DeclarativeSecurity/ZopeSecurityForDe
from
Products.CMFCore
import
permissions
from
Products.CMFCore
import
permissions
from
AccessControl
import
Permissions
as
ac_permissions
from
AccessControl
import
Permissions
as
ac_permissions
from
AccessControl.Permission
import
addPermission
setDefaultRoles
=
permissions
.
setDefaultRoles
# Default Zope Permissions
# Default Zope Permissions
View
=
permissions
.
View
View
=
permissions
.
View
...
@@ -89,14 +88,14 @@ DeletePortalContent = permissions.ModifyPortalContent
...
@@ -89,14 +88,14 @@ DeletePortalContent = permissions.ModifyPortalContent
# ERP5 addition: default content translation permissions
# ERP5 addition: default content translation permissions
# this comes from Base18
# this comes from Base18
TranslateContent
=
'Translate Content'
TranslateContent
=
'Translate Content'
setDefaultRoles
(
TranslateContent
,
(
'Manager'
,
'Owner'
,
'Member'
))
addPermission
(
TranslateContent
,
(
'Manager'
,
'Owner'
,
'Member'
))
# ERP5 additions: we define some content creations
# ERP5 additions: we define some content creations
# securities here. Each ERP5 Document will
# securities here. Each ERP5 Document will
# point to one of these securities through the
# point to one of these securities through the
# add_permission attribute
# add_permission attribute
#
#
# we define here the "
setDefaultRoles
" although
# we define here the "
addPermission
" although
# it does not apply to most roles since roles are defines
# it does not apply to most roles since roles are defines
# on a ERP5 per ERP5 user basis. Most ERP5 users will
# on a ERP5 per ERP5 user basis. Most ERP5 users will
# subclass ERP5 basic types and define their own roles
# subclass ERP5 basic types and define their own roles
...
@@ -140,7 +139,7 @@ setDefaultRoles(TranslateContent, ('Manager', 'Owner', 'Member'))
...
@@ -140,7 +139,7 @@ setDefaultRoles(TranslateContent, ('Manager', 'Owner', 'Member'))
# - using technical types / interfaces (ie. Entity, Coordinate, Predicate, etc.)
# - using technical types / interfaces (ie. Entity, Coordinate, Predicate, etc.)
#AddERP5Content = 'Add ERP5 content'
#AddERP5Content = 'Add ERP5 content'
#
setDefaultRoles
(AddERP5Content, ('Manager', ))
#
addPermission
(AddERP5Content, ('Manager', ))
AddERP5Content
=
AddPortalContent
# Since we put come CPS content in ERP5 documents, there is no rationale in having 2 permissions
AddERP5Content
=
AddPortalContent
# Since we put come CPS content in ERP5 documents, there is no rationale in having 2 permissions
# Source Code Management - this is the highest possible permission
# Source Code Management - this is the highest possible permission
...
...
product/ERP5Type/Utils.py
View file @
efa37474
...
@@ -62,7 +62,7 @@ from Products.CMFCore.DirectoryView import registerDirectory
...
@@ -62,7 +62,7 @@ from Products.CMFCore.DirectoryView import registerDirectory
from
Products.CMFCore.utils
import
getToolByName
from
Products.CMFCore.utils
import
getToolByName
from
Products.PageTemplates.Expressions
import
getEngine
from
Products.PageTemplates.Expressions
import
getEngine
from
Products.PageTemplates.Expressions
import
SecureModuleImporter
from
Products.PageTemplates.Expressions
import
SecureModuleImporter
from
Products.ZCatalog
.Lazy
import
LazyMap
from
ZTUtils
.Lazy
import
LazyMap
try
:
try
:
import
chardet
import
chardet
...
...
product/ERP5Type/patches/BTreeFolder2.py
View file @
efa37474
...
@@ -21,7 +21,7 @@ from BTrees.OOBTree import OOBTree
...
@@ -21,7 +21,7 @@ from BTrees.OOBTree import OOBTree
from
BTrees.OIBTree
import
OIBTree
,
union
from
BTrees.OIBTree
import
OIBTree
,
union
from
BTrees.Length
import
Length
from
BTrees.Length
import
Length
from
OFS.ObjectManager
import
BadRequestException
,
BeforeDeleteException
from
OFS.ObjectManager
import
BadRequestException
,
BeforeDeleteException
from
Products.ZCatalog
.Lazy
import
LazyMap
from
ZTUtils
.Lazy
import
LazyMap
from
zLOG
import
LOG
,
WARNING
,
ERROR
,
INFO
from
zLOG
import
LOG
,
WARNING
,
ERROR
,
INFO
class
ERP5BTreeFolder2Base
(
BTreeFolder2Base
):
class
ERP5BTreeFolder2Base
(
BTreeFolder2Base
):
...
...
product/ERP5Type/patches/DCWorkflow.py
View file @
efa37474
...
@@ -29,7 +29,7 @@ from Products.DCWorkflow.DCWorkflow import ObjectDeleted, ObjectMoved
...
@@ -29,7 +29,7 @@ from Products.DCWorkflow.DCWorkflow import ObjectDeleted, ObjectMoved
from
Products.DCWorkflow
import
DCWorkflow
from
Products.DCWorkflow
import
DCWorkflow
from
Products.DCWorkflow.Transitions
import
TRIGGER_WORKFLOW_METHOD
,
TransitionDefinition
from
Products.DCWorkflow.Transitions
import
TRIGGER_WORKFLOW_METHOD
,
TransitionDefinition
from
Products.DCWorkflow.Transitions
import
TRIGGER_USER_ACTION
from
Products.DCWorkflow.Transitions
import
TRIGGER_USER_ACTION
from
Products.
DCWorkflow
.permissions
import
ManagePortal
from
Products.
CMFCore
.permissions
import
ManagePortal
from
AccessControl
import
getSecurityManager
,
ModuleSecurityInfo
from
AccessControl
import
getSecurityManager
,
ModuleSecurityInfo
from
AccessControl.SecurityInfo
import
ClassSecurityInfo
from
AccessControl.SecurityInfo
import
ClassSecurityInfo
from
Products.ERP5Type.Globals
import
InitializeClass
from
Products.ERP5Type.Globals
import
InitializeClass
...
...
product/ERP5Type/patches/PropertyManager.py
View file @
efa37474
...
@@ -17,7 +17,6 @@ import six
...
@@ -17,7 +17,6 @@ import six
from
six
import
string_types
as
basestring
from
six
import
string_types
as
basestring
from
OFS.PropertyManager
import
PropertyManager
,
type_converters
from
OFS.PropertyManager
import
PropertyManager
,
type_converters
from
OFS.PropertyManager
import
escape
from
Products.ERP5Type.Globals
import
DTMLFile
from
Products.ERP5Type.Globals
import
DTMLFile
from
Products.ERP5Type.Utils
import
createExpressionContext
from
Products.ERP5Type.Utils
import
createExpressionContext
from
Products.CMFCore.Expression
import
Expression
from
Products.CMFCore.Expression
import
Expression
...
@@ -28,6 +27,12 @@ from DateTime import DateTime
...
@@ -28,6 +27,12 @@ from DateTime import DateTime
ERP5PropertyManager
=
PropertyManager
# BBB
ERP5PropertyManager
=
PropertyManager
# BBB
if
six
.
PY3
:
from
html
import
escape
else
:
from
cgi
import
escape
PropertyManager_manage_propertiesForm
=
DTMLFile
(
'properties'
,
PropertyManager_manage_propertiesForm
=
DTMLFile
(
'properties'
,
_dtmldir
,
_dtmldir
,
property_extensible_schema__
=
1
)
property_extensible_schema__
=
1
)
...
...
product/ERP5Type/patches/sqltest.py
View file @
efa37474
...
@@ -15,6 +15,8 @@ from Shared.DC.ZRDB import sqltest
...
@@ -15,6 +15,8 @@ from Shared.DC.ZRDB import sqltest
from
DateTime
import
DateTime
from
DateTime
import
DateTime
from
Products.ERP5Type
import
IS_ZOPE2
from
Products.ERP5Type
import
IS_ZOPE2
import
six
list_type_list
=
list
,
tuple
,
set
,
frozenset
,
dict
list_type_list
=
list
,
tuple
,
set
,
frozenset
,
dict
if
IS_ZOPE2
:
# BBB Zope2
if
IS_ZOPE2
:
# BBB Zope2
...
...
product/ERP5Type/tests/ERP5TypeLiveTestCase.py
View file @
efa37474
...
@@ -33,7 +33,7 @@ import imp
...
@@ -33,7 +33,7 @@ import imp
import
re
import
re
import
warnings
import
warnings
from
zope.
site
.hooks
import
setSite
from
zope.
component
.hooks
import
setSite
from
zope.globalrequest
import
getRequest
from
zope.globalrequest
import
getRequest
from
Acquisition
import
aq_base
from
Acquisition
import
aq_base
from
Testing
import
ZopeTestCase
from
Testing
import
ZopeTestCase
...
...
product/ERP5Type/tests/ERP5TypeTestCase.py
View file @
efa37474
...
@@ -37,7 +37,7 @@ from zope.globalrequest import getRequest
...
@@ -37,7 +37,7 @@ from zope.globalrequest import getRequest
from
zope.globalrequest
import
setRequest
from
zope.globalrequest
import
setRequest
import
six
import
six
from
zope.
site
.hooks
import
setSite
from
zope.
component
.hooks
import
setSite
from
Testing
import
ZopeTestCase
from
Testing
import
ZopeTestCase
from
Testing.makerequest
import
makerequest
from
Testing.makerequest
import
makerequest
...
...
product/PortalTransforms/TransformEngine.py
View file @
efa37474
...
@@ -13,7 +13,7 @@ from Products.CMFCore.ActionProviderBase import ActionProviderBase
...
@@ -13,7 +13,7 @@ from Products.CMFCore.ActionProviderBase import ActionProviderBase
from
Products.CMFCore.permissions
import
ManagePortal
,
View
from
Products.CMFCore.permissions
import
ManagePortal
,
View
from
Products.CMFCore.utils
import
registerToolInterface
,
UniqueObject
from
Products.CMFCore.utils
import
registerToolInterface
,
UniqueObject
from
Products.CMFCore.utils
import
getToolByName
from
Products.CMFCore.utils
import
getToolByName
from
Products.MimetypesRegistry.
common
import
MimeTypeException
from
Products.MimetypesRegistry.
interfaces
import
MimeTypeException
from
Products.PageTemplates.PageTemplateFile
import
PageTemplateFile
from
Products.PageTemplates.PageTemplateFile
import
PageTemplateFile
from
Products.PortalTransforms.data
import
datastream
from
Products.PortalTransforms.data
import
datastream
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment