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
Alain Takoudjou
erp5
Commits
dde89f18
Commit
dde89f18
authored
May 16, 2019
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XXX: Remove multi-level inheritance from CopyContainer
Base inherits from it, and BaseTool inherits from Base.
parent
246f5c12
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
5 deletions
+30
-5
product/ERP5/Tool/CategoryTool.py
product/ERP5/Tool/CategoryTool.py
+15
-1
product/ERP5Type/Core/Folder.py
product/ERP5Type/Core/Folder.py
+15
-4
No files found.
product/ERP5/Tool/CategoryTool.py
View file @
dde89f18
...
...
@@ -44,7 +44,7 @@ from Products.ERP5Type.dynamic import portal_type_class
from
zLOG
import
LOG
class
CategoryTool
(
C
opyContainer
,
C
MFCategoryTool
,
BaseTool
):
class
CategoryTool
(
CMFCategoryTool
,
BaseTool
):
"""
The CategoryTool object is the placeholder for all methods
and algorithms related to categories and relations in ERP5.
...
...
@@ -152,4 +152,18 @@ class CategoryTool(CopyContainer, CMFCategoryTool, BaseTool):
self
.
updateRelatedContent
(
o
,
previous_o_category_url
,
new_o_category_url
)
# CMFCategoryTool inherits indirectly from a different CopyContainer which
# lacks our customisations.
# Resolve all inheritence conflicts between CopyContainer (which CategoryTool
# inherits from via BaseTool) and CMFCategoryTool in favour of the property
# from BaseTool (so it may override CopyContainer).
for
CopyContainer_property_id
in
CopyContainer
.
__dict__
:
if
CopyContainer_property_id
in
CategoryTool
.
__dict__
:
continue
try
:
BaseTool_property
=
getattr
(
BaseTool
,
CopyContainer_property_id
)
except
AttributeError
:
continue
setattr
(
CategoryTool
,
CopyContainer_property_id
,
BaseTool_property
)
InitializeClass
(
CategoryTool
)
product/ERP5Type/Core/Folder.py
View file @
dde89f18
...
...
@@ -588,7 +588,7 @@ _HANDLER_LIST = (
# Bad value, accidentally put everywhere long ago
_BROKEN_BTREE_HANDLER
=
'CMFBTreeFolderHandler'
class
Folder
(
CopyContainer
,
OFSFolder2
,
CMFBTreeFolder
,
CMFHBTreeFolder
,
Base
,
FolderMixIn
):
class
Folder
(
OFSFolder2
,
CMFBTreeFolder
,
CMFHBTreeFolder
,
Base
,
FolderMixIn
):
"""
A Folder is a subclass of Base but not of XMLObject.
Folders are not considered as documents and are therefore
...
...
@@ -1036,9 +1036,6 @@ class Folder(CopyContainer, OFSFolder2, CMFBTreeFolder, CMFHBTreeFolder, Base, F
return
id
return
self
.
generateNewId
()
#security.declareProtected( Permissions.DeletePortalContent, 'manage_delObjects' )
#manage_delObjects = CopyContainer.manage_delObjects
# Implementation
hasContent
=
hasObject
...
...
@@ -1643,3 +1640,17 @@ for source_klass, destination_klass in \
# Zope 2.7 required to have methodId__roles__ defined
# to know the security ot the method
setattr
(
destination_klass
,
method_id
+
'__roles__'
,
None
)
# Some of Folder base inherits indirectly from a different CopyContainer which
# lacks our customisations.
# Resolve all inheritence conflicts between CopyContainer (which Folder
# inherits from via Base) and those bases in favour of the property
# from Base (so it may override CopyContainer).
for
CopyContainer_property_id
in
CopyContainer
.
__dict__
:
if
CopyContainer_property_id
in
Folder
.
__dict__
:
continue
try
:
Base_property
=
getattr
(
Base
,
CopyContainer_property_id
)
except
AttributeError
:
continue
setattr
(
Folder
,
CopyContainer_property_id
,
Base_property
)
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