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
Alexander Emmerich
erp5
Commits
a282fc24
Commit
a282fc24
authored
Feb 24, 2014
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZODB Components: Do not export some Workflow History fields.
These are completely useless and create conflicts with VCSs.
parent
fbfcb3b2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
7 deletions
+24
-7
product/ERP5/Document/BusinessTemplate.py
product/ERP5/Document/BusinessTemplate.py
+7
-2
product/ERP5/tests/testBusinessTemplate.py
product/ERP5/tests/testBusinessTemplate.py
+17
-5
No files found.
product/ERP5/Document/BusinessTemplate.py
View file @
a282fc24
...
...
@@ -3945,8 +3945,13 @@ class DocumentTemplateItem(FilesystemToZodbTemplateItem):
del
obj
.
workflow_history
[
wf_id
]
continue
wf_history_list
=
obj
.
workflow_history
[
wf_id
]
obj
.
workflow_history
[
wf_id
]
=
WorkflowHistoryList
([
wf_history_list
[
-
1
]])
wf_history
=
obj
.
workflow_history
[
wf_id
][
-
1
]
# Remove useless modifcation 'time' and 'actor' (conflicts with VCSs)
del
wf_history
[
'time'
]
del
wf_history
[
'actor'
]
del
wf_history
[
'comment'
]
obj
.
workflow_history
[
wf_id
]
=
WorkflowHistoryList
([
wf_history
])
def
_importFile
(
self
,
file_name
,
file_obj
):
"""
...
...
product/ERP5/tests/testBusinessTemplate.py
View file @
a282fc24
...
...
@@ -7415,9 +7415,17 @@ class TestDocumentTemplateItem(BusinessTemplateMixin):
sequence
[
'document_id'
],
None
)
self
.
assertNotEqual
(
component
,
None
)
self
.
assertEqual
(
sorted
(
list
(
component
.
workflow_history
)),
[
'component_validation_workflow'
,
'edit_workflow'
])
self
.
assertFalse
(
len
(
component
.
workflow_history
[
'component_validation_workflow'
])
<=
1
)
all_wf_history_dict
=
component
.
workflow_history
self
.
assertEqual
(
sorted
(
list
(
all_wf_history_dict
)),
[
'component_validation_workflow'
,
'edit_workflow'
])
wf_history_dict_list
=
all_wf_history_dict
[
'component_validation_workflow'
]
self
.
assertFalse
(
len
(
wf_history_dict_list
)
<=
1
)
for
wf_history_dict
in
wf_history_dict_list
:
self
.
assertNotEqual
(
wf_history_dict
.
get
(
'time'
),
None
)
self
.
assertNotEqual
(
wf_history_dict
.
get
(
'actor'
),
None
)
self
.
assertNotEqual
(
wf_history_dict
.
get
(
'comment'
),
None
)
def
stepRemoveZodbDocument
(
self
,
sequence
=
None
,
**
kw
):
self
.
getPortalObject
().
portal_components
.
deleteContent
(
...
...
@@ -7430,13 +7438,17 @@ class TestDocumentTemplateItem(BusinessTemplateMixin):
self
.
assertNotEqual
(
component
,
None
)
self
.
assertEqual
(
component
.
getValidationState
(),
'validated'
)
# Only the last Workflow History should have been exported
# Only the last Workflow History should have been exported and without
# 'time' as it is not needed and create conflicts with VCSs
self
.
assertEqual
(
list
(
component
.
workflow_history
),
[
'component_validation_workflow'
])
validation_state_only_list
=
[]
for
validation_dict
in
list
(
component
.
workflow_history
[
'component_validation_workflow'
])
:
for
validation_dict
in
component
.
workflow_history
[
'component_validation_workflow'
]
:
validation_state_only_list
.
append
(
validation_dict
.
get
(
'validation_state'
))
self
.
assertEqual
(
validation_dict
.
get
(
'time'
),
None
)
self
.
assertEqual
(
validation_dict
.
get
(
'actor'
),
None
)
self
.
assertEqual
(
validation_dict
.
get
(
'comment'
),
None
)
self
.
assertEqual
(
validation_state_only_list
,
[
'validated'
])
...
...
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