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
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
Nikola Balog
erp5
Commits
1a1432e1
Commit
1a1432e1
authored
Jul 21, 2011
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify and use installBusinessTemplateListFromRepository API.
parent
b4f92798
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
17 deletions
+10
-17
product/ERP5Configurator/Document/StandardBT5ConfiguratorItem.py
.../ERP5Configurator/Document/StandardBT5ConfiguratorItem.py
+10
-17
No files found.
product/ERP5Configurator/Document/StandardBT5ConfiguratorItem.py
View file @
1a1432e1
...
@@ -60,24 +60,17 @@ class StandardBT5ConfiguratorItem(ConfiguratorItemMixin, XMLObject):
...
@@ -60,24 +60,17 @@ class StandardBT5ConfiguratorItem(ConfiguratorItemMixin, XMLObject):
)
)
def
_build
(
self
,
business_configuration
):
def
_build
(
self
,
business_configuration
):
bt5_id
=
self
.
getBt5Id
()
template_tool
=
self
.
getPortalObject
().
portal_templates
portal
=
self
.
getPortalObject
()
bt5_id
=
self
.
getBt5Id
().
split
(
'.'
)[
0
]
template_tool
=
getToolByName
(
portal
,
'portal_templates'
)
for
bt5
in
template_tool
.
getRepositoryBusinessTemplateList
():
if
bt5_id
==
bt5
.
getTitle
():
template_tool
.
installBusinessTemplateListFromRepository
([
bt5_id
],
update_catalog
=
self
.
getUpdateCatalog
(
0
))
installed_bt_list
=
template_tool
.
getInstalledBusinessTemplateTitleList
()
if
business_configuration
.
isStandardBT5
(
bt5_id
):
if
bt5_id
not
in
installed_bt_list
:
update_catalog
=
self
.
getUpdateCatalog
(
0
)
bt_url
=
template_tool
.
getBusinessTemplateUrl
(
None
,
bt5_id
)
template_tool
.
updateBusinessTemplateFromUrl
(
bt_url
,
update_catalog
=
update_catalog
)
LOG
(
"StandardBT5ConfiguratorItem"
,
INFO
,
LOG
(
"StandardBT5ConfiguratorItem"
,
INFO
,
"Install %s for %s"
%
(
bt_url
,
self
.
getRelativeUrl
()))
"Install %s for %s"
%
(
bt5_id
,
self
.
getRelativeUrl
()))
else
:
return
LOG
(
"StandardBT5ConfiguratorItem"
,
INFO
,
"%s is already present. Ignore installation (%s)"
\
raise
ValueError
(
"The business template %s was not found on available
\
%
(
bt5_id
,
self
.
getRelativeUrl
()))
else
:
raise
ValueError
(
"The business template %s was not found on available
\
sources."
%
bt5_id
)
sources."
%
bt5_id
)
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