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
Labels
Merge Requests
141
Merge Requests
141
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
9e66493a
Commit
9e66493a
authored
Dec 30, 2020
by
Aurel
Committed by
Aurel
Jan 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BusinessTemplate: when installing tool, register it on the site manager
parent
107265a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
product/ERP5/Document/BusinessTemplate.py
product/ERP5/Document/BusinessTemplate.py
+6
-0
No files found.
product/ERP5/Document/BusinessTemplate.py
View file @
9e66493a
...
...
@@ -39,6 +39,7 @@ from AccessControl.SecurityManagement import getSecurityManager, \
newSecurityManager
,
setSecurityManager
from
AccessControl.User
import
nobody
from
Products.CMFCore.utils
import
getToolByName
from
Products.CMFCore
import
utils
from
Products.PythonScripts.PythonScript
import
PythonScript
from
Products.ZSQLMethods.SQL
import
SQL
from
Products.ERP5Type.Accessor.Constant
import
PropertyGetter
as
ConstantGetter
...
...
@@ -1869,6 +1870,7 @@ class ToolTemplateItem(PathTemplateItem):
def
install
(
self
,
context
,
trashbin
,
**
kw
):
""" When we install a tool that is a type provider not
registered on types tool, register it into the type provider.
We also need to register the tool on the site manager
"""
PathTemplateItem
.
install
(
self
,
context
,
trashbin
,
**
kw
)
portal
=
context
.
getPortalObject
()
...
...
@@ -1879,6 +1881,10 @@ class ToolTemplateItem(PathTemplateItem):
type_container_id
not
in
types_tool
.
type_provider_list
):
types_tool
.
type_provider_list
=
tuple
(
types_tool
.
type_provider_list
)
+
\
(
type_container_id
,)
tool_interface
=
utils
.
_tool_interface_registry
.
get
(
type_container_id
)
if
tool_interface
is
not
None
:
sm
=
self
.
getPortalObject
().
_components
sm
.
registerUtility
(
aq_base
(
portal
.
get
(
type_container_id
)),
tool_interface
)
def
uninstall
(
self
,
context
,
**
kw
):
""" When we uninstall a tool, unregister it from the type provider. """
...
...
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