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
Leo Le Bouter
erp5
Commits
c698b889
Commit
c698b889
authored
Mar 22, 2015
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workflow.py: fix workflow history list variables' values, remove _p_changed.
parent
fac87819
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
product/ERP5Workflow/Document/Workflow.py
product/ERP5Workflow/Document/Workflow.py
+12
-7
No files found.
product/ERP5Workflow/Document/Workflow.py
View file @
c698b889
...
...
@@ -100,15 +100,21 @@ class Workflow(XMLObject):
# Initialize workflow history
status_dict
=
{
state_bc_id
:
document
.
unrestrictedTraverse
(
self
.
getSource
()).
getId
()}
#status_dict['time'] = self.getDateTime()
#status_dict['action'] = None
variable_list
=
self
.
contentValues
(
portal_type
=
'Variable'
)
former_status
=
self
.
_getOb
(
status_dict
[
state_bc_id
],
None
)
ec
=
Expression_createExprContext
(
StateChangeInfo
(
document
,
self
,
former_status
))
for
variable
in
variable_list
:
if
variable
.
for_status
==
0
:
continue
status_dict
[
variable
.
getId
()]
=
variable
.
getInitialValue
(
object
=
object
)
if
variable
.
default_expr
is
not
None
:
expr
=
Expression
(
variable
.
default_expr
)
value
=
expr
(
ec
)
else
:
value
=
variable
.
getInitialValue
(
object
=
object
)
status_dict
[
variable
.
getId
()]
=
value
self
.
_updateWorkflowHistory
(
document
,
status_dict
)
### zwj: initialize role mappings, also in State.py/executeTransition()
self
.
updateRoleMappingsFor
(
document
)
def
_generateHistoryKey
(
self
):
...
...
@@ -134,13 +140,12 @@ class Workflow(XMLObject):
document
.
workflow_history
[
workflow_key
]
=
()
# Update history
#status_dict['time'] = self.getDateTime()
document
.
workflow_history
[
workflow_key
]
+=
(
status_dict
,)
# XXX this _p_changed marks the document modified, but the
# only the PersistentMapping is modified
document
.
_p_changed
=
1
#
document._p_changed = 1
# XXX this _p_changed is apparently not necessary
document
.
workflow_history
.
_p_changed
=
1
#
document.workflow_history._p_changed = 1
def
getCurrentStatusDict
(
self
,
document
):
"""
...
...
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