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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastien Robin
erp5
Commits
b8e53d65
Commit
b8e53d65
authored
Feb 09, 2022
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Site: Define core business template list in a convenient place.
Also, use it in Products.ERP5Type.tests.ERP5TypeTestCase.
parent
8ad44c55
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
4 deletions
+26
-4
product/ERP5/ERP5Site.py
product/ERP5/ERP5Site.py
+17
-2
product/ERP5Type/tests/ERP5TypeTestCase.py
product/ERP5Type/tests/ERP5TypeTestCase.py
+9
-2
No files found.
product/ERP5/ERP5Site.py
View file @
b8e53d65
...
...
@@ -278,6 +278,22 @@ class ERP5Site(ResponseHeaderGenerator, FolderMixIn, PortalObjectBase, CacheCook
PortalObjectBase
.
__init__
(
self
,
id
)
self
.
creation_date
=
DateTime
()
security
.
declarePrivate
(
'getCoreBusinessTemplateList'
)
def
getCoreBusinessTemplateList
(
self
):
"""
Return the list of business templates expected to be installed when this
class is instanciated. Allows including these business templates in the
list of business templates to upgrade (ex: in upgrade unit tests) without
duplicating this list.
"""
return
[
'erp5_property_sheets'
,
'erp5_core'
,
self
.
erp5_catalog_storage
,
'erp5_jquery'
,
'erp5_xhtml_style'
,
]
security
.
declarePrivate
(
'reindexObject'
)
def
reindexObject
(
self
,
idxs
=
[]):
"""from Products.CMFDefault.Portal"""
...
...
@@ -2402,8 +2418,7 @@ class ERP5Generator(PortalGenerator):
"""
template_tool
=
p
.
portal_templates
if
template_tool
.
getInstalledBusinessTemplate
(
'erp5_core'
)
is
None
:
for
bt
in
(
'erp5_property_sheets'
,
'erp5_core'
,
p
.
erp5_catalog_storage
,
'erp5_jquery'
,
'erp5_xhtml_style'
):
for
bt
in
p
.
getCoreBusinessTemplateList
():
if
not
bt
:
continue
url
=
getBootstrapBusinessTemplateUrl
(
bt
)
...
...
product/ERP5Type/tests/ERP5TypeTestCase.py
View file @
b8e53d65
...
...
@@ -1047,8 +1047,15 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
update_business_templates
=
os
.
environ
.
get
(
'update_business_templates'
)
is
not
None
erp5_load_data_fs
=
int
(
os
.
environ
.
get
(
'erp5_load_data_fs'
,
0
))
if
update_business_templates
and
erp5_load_data_fs
:
template_list
[:
0
]
=
(
erp5_catalog_storage
,
'erp5_property_sheets'
,
'erp5_core'
,
'erp5_xhtml_style'
)
app
=
self
.
_app
()
try
:
template_list
[:
0
]
=
app
.
_getOb
(
self
.
getPortalName
(),
).
getCoreBusinessTemplateList
()
finally
:
self
.
abort
()
ZopeTestCase
.
close
(
app
)
del
app
# keep a mapping type info name -> property sheet list, to remove them in
# tear down.
...
...
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