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
421b11a7
Commit
421b11a7
authored
Jan 04, 2018
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CommitTool: Get installed snapshot
parent
c0de00bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
product/ERP5/Tool/CommitTool.py
product/ERP5/Tool/CommitTool.py
+16
-0
No files found.
product/ERP5/Tool/CommitTool.py
View file @
421b11a7
...
...
@@ -178,6 +178,22 @@ class CommitTool (BaseTool):
def
getSnapshotList
(
self
):
return
self
.
objectValues
(
portal_type
=
'Business Snapshot'
)
def
getInstalledSnapshot
(
self
):
"""
Return the installed snapshot.
Returns None in case there is no snapshot installed.
"""
snapshot
=
[
l
for
l
in
self
.
getSnapshotList
()
if
l
.
getValidationState
()
==
'installed'
]
if
len
(
snapshot
)
==
1
:
return
snapshot
[
0
]
elif
len
(
snapshot
)
>
1
:
raise
ValueError
(
'Multiple Snapshot in installed state'
)
else
:
return
None
security
.
declarePublic
(
'newContent'
)
def
newContent
(
self
,
id
=
None
,
portal_type
=
None
,
**
kw
):
"""
...
...
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