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
b687aba3
Commit
b687aba3
authored
Dec 12, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_config: Use mutual similar category for Business Snapshot and Business Commit
parent
4600dd9f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
23 deletions
+16
-23
product/ERP5/Document/BusinessCommit.py
product/ERP5/Document/BusinessCommit.py
+3
-2
product/ERP5/Document/BusinessSnapshot.py
product/ERP5/Document/BusinessSnapshot.py
+13
-21
No files found.
product/ERP5/Document/BusinessCommit.py
View file @
b687aba3
...
...
@@ -130,7 +130,8 @@ class BusinessCommit(Folder):
snapshot
=
portal_commit
.
newContent
(
portal_type
=
'Business Snapshot'
)
# Add the current commit as predecessor. This way we can have the BI
# BPI in that commit to the Business Snapshot also.
snapshot
.
setPredecessorValue
(
self
)
snapshot
.
setSimilarValue
(
self
)
self
.
setSimilarValue
(
snapshot
)
# Build the snapshot
snapshot
.
buildSnapshot
()
...
...
@@ -154,7 +155,7 @@ class BusinessCommit(Folder):
# Create a new equivalent snapshot
eqv_snapshot
=
self
.
createEquivalentSnapshot
()
for
item
in
eqv_snapshot
.
item_list
:
for
item
in
eqv_snapshot
.
objectValues
()
:
item
.
install
(
self
)
def
getItemPathList
(
self
):
...
...
product/ERP5/Document/BusinessSnapshot.py
View file @
b687aba3
...
...
@@ -114,23 +114,6 @@ class BusinessSnapshot(Folder):
PropertySheet
.
Version
,
)
# Attribute to store item list which are basically hardlinks
item_list
=
[]
def
__init__
(
self
,
id
):
"""
While creating a new Business Snapshot, we need to create the hardlinks
and create a snapshot from the commits.
"""
super
(
BusinessSnapshot
,
self
).
__init__
(
id
)
def
install
(
self
):
"""
Installing a snapshot should be similar to installing an installation_state
we used to have for Business Manager(s)
"""
pass
def
getLastSnapshot
(
self
):
portal
=
self
.
getPortalObject
()
...
...
@@ -152,7 +135,7 @@ class BusinessSnapshot(Folder):
Returns the collection of all Business Item, Business Property Item and
Business Patch item at the given snapshot.
"""
return
self
.
item_list
return
self
.
objectValues
()
def
getItemPathList
(
self
):
"""
...
...
@@ -169,7 +152,7 @@ class BusinessSnapshot(Folder):
new_item_path_list
=
[]
# Get the equivalent commit for the snapshot
eqv_commit
=
self
.
get
Predecesso
rValue
()
eqv_commit
=
self
.
get
Simila
rValue
()
# Get last created snapshot
last_snapshot
=
self
.
getLastSnapshot
()
...
...
@@ -193,7 +176,7 @@ class BusinessSnapshot(Folder):
# Here the first next commit should be the commit created after last snapshot
# which we can get using the equivalent commit of last snapshot and then
# finding the next commit for it
next_commit
=
last_snapshot
.
get
Predecesso
rValue
().
getPredecessorRelatedValue
()
next_commit
=
last_snapshot
.
get
Simila
rValue
().
getPredecessorRelatedValue
()
# If there is no last snapshot, create a new one by combining all the commits
else
:
...
...
@@ -226,4 +209,13 @@ class BusinessSnapshot(Folder):
new_item_list
.
append
(
item
)
new_item_path_list
.
append
(
item_path
)
self
.
item_list
=
new_item_list
# Create hardlinks for the objects
for
item
in
new_item_list
:
self
.
_setObject
(
item
.
id
,
item
,
suppress_events
=
True
)
def
install
(
self
):
"""
Install the sub-objects in the commit
"""
for
item
in
self
.
objectValues
():
item
.
install
(
self
)
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