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
Hugo Ricateau
erp5
Commits
307c24d1
Commit
307c24d1
authored
Dec 22, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CommitTool: Installation should take care of states
parent
a8b08028
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
2 deletions
+30
-2
product/ERP5/Document/BusinessCommit.py
product/ERP5/Document/BusinessCommit.py
+21
-2
product/ERP5/Tool/CommitTool.py
product/ERP5/Tool/CommitTool.py
+9
-0
No files found.
product/ERP5/Document/BusinessCommit.py
View file @
307c24d1
...
...
@@ -144,6 +144,7 @@ class BusinessCommit(Folder):
- check if there is already an equivalent snapshot
- if not, create one and install it
"""
site
=
self
.
getPortalObject
()
successor_list
=
self
.
getPredecessorRelatedValueList
()
# Check if the successor list has a snapshot in it
...
...
@@ -155,8 +156,26 @@ class BusinessCommit(Folder):
# Create a new equivalent snapshot
eqv_snapshot
=
self
.
createEquivalentSnapshot
()
for
item
in
eqv_snapshot
.
objectValues
():
item
.
install
(
self
)
# When installing Business Snapshot, installation state should be changed
if
eqv_snapshot
not
in
[
None
,
self
]:
if
site
.
portal_workflow
.
isTransitionPossible
(
eqv_snapshot
,
'install'
):
eqv_snapshot
.
install
(
self
)
def
getItemPathList
(
self
):
return
[
l
.
getProperty
(
'item_path'
)
for
l
in
self
.
objectValues
()]
def
getBusinessManagerList
(
self
):
"""
Give the list of all Business Manager(s) being touched by this Business
Commit
"""
manager_list
=
[]
for
item
in
self
.
objectValues
():
manager_list
.
extend
(
item
.
getFollowUpValueList
())
return
list
(
set
(
manager_list
))
def
getBusinessManagerTitleList
(
self
):
title_list
=
[
l
.
getTitle
()
for
l
in
self
.
getBusinessManagerList
()]
return
title_list
product/ERP5/Tool/CommitTool.py
View file @
307c24d1
...
...
@@ -182,7 +182,16 @@ class CommitTool (BaseTool):
def
newContent
(
self
,
id
=
None
,
**
kw
):
"""
Override newContent so as to use 'id' generated like hash
Also, create new commit only when all old commits are committed
"""
old_commit_list
=
self
.
objectValues
(
portal_type
=
'Business Commit'
)
# Check if all the commits created before are commited or not
all_commited
=
all
([
l
.
getTranslatedValidationState
()
==
'commited'
for
l
in
old_commit_list
])
if
not
all_commited
:
raise
ValueError
(
'Please commit your last commit before creating new one'
)
if
id
is
None
:
id
=
uuid
.
uuid1
()
...
...
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