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
1
Issues
1
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
Roque
erp5
Commits
9e53f10c
Commit
9e53f10c
authored
Sep 27, 2017
by
Ayush Tiwari
Committed by
Ayush Tiwari
Nov 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_catalog: Bootstrap allowed_types for Catalog Tool
parent
7d897440
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
product/ERP5/ERP5Site.py
product/ERP5/ERP5Site.py
+8
-0
product/ERP5Type/Tool/TypesTool.py
product/ERP5Type/Tool/TypesTool.py
+3
-0
No files found.
product/ERP5/ERP5Site.py
View file @
9e53f10c
...
...
@@ -1971,6 +1971,14 @@ class ERP5Generator(PortalGenerator):
load
(
os
.
path
.
join
(
root
,
file
+
'.xml'
),
verify
=
False
,
set_owner
=
False
,
suppress_events
=
True
)
@
staticmethod
def
bootstrap_allow_type
(
types_tool
,
portal_type
):
from
xml.etree.cElementTree
import
parse
bt_path
=
getBootstrapBusinessTemplateUrl
(
'erp5_core'
)
types_tool
[
portal_type
].
allowed_content_types
=
[
x
.
text
for
x
in
parse
(
os
.
path
.
join
(
bt_path
,
'PortalTypeAllowedContentTypeTemplateItem'
,
'allowed_content_types.xml'
)
).
iterfind
(
"portal_type[@id='%s']/*"
%
portal_type
)]
def
setupLastTools
(
self
,
p
,
**
kw
):
"""
Set up finals tools
...
...
product/ERP5Type/Tool/TypesTool.py
View file @
9e53f10c
...
...
@@ -130,7 +130,10 @@ class TypesTool(TypeProvider):
'Acquired Property'
,
# the following ones are required to upgrade an existing site
'Category Property'
,
# the following is needed to bootstrap Catalog Tool and default catalog
'Catalog Tool'
,
))
ERP5Generator
.
bootstrap_allow_type
(
self
,
'Catalog Tool'
)
def
listContentTypes
(
self
,
container
=
None
):
"""List content types from all providers
...
...
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