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
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Lu Xu
erp5
Commits
1efb76e6
Commit
1efb76e6
authored
Sep 13, 2019
by
Bryton Lacquement
🚪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
patches/{DynamicType,WorkflowTool}: do not use queryUtility to access tools
parent
a6e3cc76
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
0 deletions
+40
-0
product/ERP5Type/ZopePatch.py
product/ERP5Type/ZopePatch.py
+1
-0
product/ERP5Type/patches/DynamicType.py
product/ERP5Type/patches/DynamicType.py
+26
-0
product/ERP5Type/patches/WorkflowTool.py
product/ERP5Type/patches/WorkflowTool.py
+13
-0
No files found.
product/ERP5Type/ZopePatch.py
View file @
1efb76e6
...
...
@@ -34,6 +34,7 @@ from Products.ERP5Type.patches import DCWorkflow
from
Products.ERP5Type.patches
import
Worklists
from
Products.ERP5Type.patches
import
BTreeFolder2
from
Products.ERP5Type.patches
import
WorkflowTool
from
Products.ERP5Type.patches
import
DynamicType
from
Products.ERP5Type.patches
import
XMLExportImport
from
Products.ERP5Type.patches
import
ppml
from
Products.ERP5Type.patches
import
Expression
...
...
product/ERP5Type/patches/DynamicType.py
0 → 100644
View file @
1efb76e6
##############################################################################
#
# Copyright (c) 2001 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
from
Products.CMFCore.DynamicType
import
DynamicType
def
getTypeInfo
(
self
):
""" Get the TypeInformation object specified by the portal type.
"""
# <patch>
tool
=
getattr
(
self
.
getPortalObject
(),
"portal_types"
,
None
)
# </patch>
if
tool
is
None
:
return
None
return
tool
.
getTypeInfo
(
self
)
# Can return None.
DynamicType
.
getTypeInfo
=
getTypeInfo
product/ERP5Type/patches/WorkflowTool.py
View file @
1efb76e6
...
...
@@ -950,4 +950,17 @@ def canDoActionFor(self, ob, action, wf_id=None, guard_kw={}):
WorkflowTool
.
canDoActionFor
=
canDoActionFor
security
.
declarePrivate
(
'_listTypeInfo'
)
def
_listTypeInfo
(
self
):
""" List the portal types which are available.
"""
# <patch>
ttool
=
getattr
(
self
.
getPortalObject
(),
"portal_types"
,
None
)
# </patch>
if
ttool
is
not
None
:
return
ttool
.
listTypeInfo
()
return
()
WorkflowTool
.
_listTypeInfo
=
_listTypeInfo
InitializeClass
(
WorkflowTool
)
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