Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush Tiwari
erp5
Commits
a38c0782
Commit
a38c0782
authored
Sep 27, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_catalog: Boostrap allowed_types for Catalog Tool
parent
4d529450
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
product/ERP5/ERP5Site.py
product/ERP5/ERP5Site.py
+9
-0
product/ERP5Type/Tool/TypesTool.py
product/ERP5Type/Tool/TypesTool.py
+3
-0
No files found.
product/ERP5/ERP5Site.py
View file @
a38c0782
...
...
@@ -21,6 +21,7 @@ from OFS.Application import Application, AppInitializer
from
Products.ERP5Type
import
Globals
from
Products.ERP5Type.Globals
import
package_home
from
lxml.etree
import
parse
from
Products.SiteErrorLog.SiteErrorLog
import
manage_addErrorLog
from
ZPublisher
import
BeforeTraverse
from
ZPublisher.BaseRequest
import
RequestContainer
...
...
@@ -1941,6 +1942,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'
)
setattr
(
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 @
a38c0782
...
...
@@ -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