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
Alain Takoudjou
erp5
Commits
9203e6da
Commit
9203e6da
authored
Jan 09, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_prototype: Implement mapToERP5Site function for InstallationTree class
parent
4f63d85c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
product/ERP5/Document/BusinessPackage.py
product/ERP5/Document/BusinessPackage.py
+20
-4
No files found.
product/ERP5/Document/BusinessPackage.py
View file @
9203e6da
...
...
@@ -467,7 +467,7 @@ def createInstallationData(package_list):
conflicted_data
[
path
].
append
(
object_metadata
)
# If the path is new, add the metadata to final_data
elif
not
data
.
has_key
(
path
):
elif
not
final_
data
.
has_key
(
path
):
final_data
[
path
]
=
object_metadata
# If the object is neither in conflicted_data already in final_data,
...
...
@@ -527,7 +527,7 @@ class InstallationTree(object):
"""
self
.
children
.
append
(
state
)
def
mapToERP5Site
(
self
):
def
mapToERP5Site
(
self
,
context
=
None
):
"""
Create a new state by comparing all BP combined built and the ERP5Site,
then calls setNewState to update the state
...
...
@@ -535,5 +535,21 @@ class InstallationTree(object):
as ZODB. The Installation Tree should be smart enough to take us nearest to
the installed state. If any conflict whatsoever arise, it should raise it.
"""
# No need to create sha here, save it in business package itself
pass
# Return if the context is None
if
context
is
None
:
return
for
path
,
metadata
in
self
.
data
.
items
():
obj
=
metadata
[
'obj'
]
path_list
=
path
.
split
(
'/'
)
container_path
=
path_list
[:
-
1
]
object_id
=
path_list
[
-
1
]
try
:
container
=
context
.
unrestrictedTraverse
(
container_path
)
except
KeyError
:
# parent object can be set to nothing, in this case just go on
container_url
=
'/'
.
join
(
container_path
)
old_obj
=
container
.
_getOb
(
object_id
,
None
)
# install object
obj
=
obj
.
_getCopy
(
container
)
container
.
_setObject
(
object_id
,
obj
)
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