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
82c9b260
Commit
82c9b260
authored
Dec 26, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CommitTool: Update workflow status of old snapshot before installling a new snapshot
parent
9b9a1a03
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
17 deletions
+30
-17
product/ERP5/Document/BusinessCommit.py
product/ERP5/Document/BusinessCommit.py
+1
-1
product/ERP5/Document/BusinessSnapshot.py
product/ERP5/Document/BusinessSnapshot.py
+27
-14
product/ERP5/Tool/CommitTool.py
product/ERP5/Tool/CommitTool.py
+2
-2
No files found.
product/ERP5/Document/BusinessCommit.py
View file @
82c9b260
...
@@ -160,7 +160,7 @@ class BusinessCommit(Folder):
...
@@ -160,7 +160,7 @@ class BusinessCommit(Folder):
if
eqv_snapshot
not
in
[
None
,
self
]:
if
eqv_snapshot
not
in
[
None
,
self
]:
if
site
.
portal_workflow
.
isTransitionPossible
(
if
site
.
portal_workflow
.
isTransitionPossible
(
eqv_snapshot
,
'install'
):
eqv_snapshot
,
'install'
):
eqv_snapshot
.
install
(
self
)
eqv_snapshot
.
install
()
def
getItemPathList
(
self
):
def
getItemPathList
(
self
):
return
[
l
.
getProperty
(
'item_path'
)
for
l
in
self
.
objectValues
()]
return
[
l
.
getProperty
(
'item_path'
)
for
l
in
self
.
objectValues
()]
...
...
product/ERP5/Document/BusinessSnapshot.py
View file @
82c9b260
...
@@ -114,7 +114,25 @@ class BusinessSnapshot(Folder):
...
@@ -114,7 +114,25 @@ class BusinessSnapshot(Folder):
PropertySheet
.
Version
,
PropertySheet
.
Version
,
)
)
def
getItemList
(
self
):
"""
Returns the collection of all Business Item, Business Property Item and
Business Patch item at the given snapshot.
"""
return
self
.
objectValues
()
def
getItemPathList
(
self
):
"""
Returns the path of all Business Item, Business Property Item and
Business Patch item at the given snapshot.
"""
return
[
l
.
getProperty
(
'item_path'
)
for
l
in
self
.
getItemList
()]
def
getLastSnapshot
(
self
):
def
getLastSnapshot
(
self
):
"""
Get last snapshot exisiting.
Returns None if there is no last snapshot.
"""
portal
=
self
.
getPortalObject
()
portal
=
self
.
getPortalObject
()
commit_tool
=
portal
.
portal_commits
commit_tool
=
portal
.
portal_commits
...
@@ -130,20 +148,6 @@ class BusinessSnapshot(Folder):
...
@@ -130,20 +148,6 @@ class BusinessSnapshot(Folder):
return
None
return
None
def
getItemList
(
self
):
"""
Returns the collection of all Business Item, Business Property Item and
Business Patch item at the given snapshot.
"""
return
self
.
objectValues
()
def
getItemPathList
(
self
):
"""
Returns the path of all Business Item, Business Property Item and
Business Patch item at the given snapshot.
"""
return
[
l
.
getProperty
(
'item_path'
)
for
l
in
self
.
getItemList
()]
def
buildSnapshot
(
self
):
def
buildSnapshot
(
self
):
"""
"""
Using equivalent commit, create a snapshot of ZODB state
Using equivalent commit, create a snapshot of ZODB state
...
@@ -217,5 +221,14 @@ class BusinessSnapshot(Folder):
...
@@ -217,5 +221,14 @@ class BusinessSnapshot(Folder):
"""
"""
Install the sub-objects in the commit
Install the sub-objects in the commit
"""
"""
site
=
self
.
getPortalObject
()
# While installing the last snapshot state should be changed to 'replaced'
last_snapshot
=
self
.
getLastSnapshot
()
if
last_snapshot
not
in
[
None
,
self
]:
if
site
.
portal_workflow
.
isTransitionPossible
(
last_snapshot
,
'replace'
):
last_snapshot
.
replace
(
self
)
# Now install the items in new snapshot
for
item
in
self
.
objectValues
():
for
item
in
self
.
objectValues
():
item
.
install
(
self
)
item
.
install
(
self
)
product/ERP5/Tool/CommitTool.py
View file @
82c9b260
...
@@ -159,8 +159,8 @@ class CommitTool (BaseTool):
...
@@ -159,8 +159,8 @@ class CommitTool (BaseTool):
meta_type
=
'ERP5 Commit Tool'
meta_type
=
'ERP5 Commit Tool'
portal_type
=
'Commit Tool'
portal_type
=
'Commit Tool'
allowed_types
=
(
allowed_types
=
(
'
ERP5
Business Commit'
,
'Business Commit'
,
'
ERP5
Business Snapshot'
,
'Business Snapshot'
,
)
)
# This stores information on repositories.
# This stores information on repositories.
...
...
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