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
Carlos Ramos Carreño
erp5
Commits
21ef5b95
Commit
21ef5b95
authored
Jun 23, 2015
by
wenjie.zheng
Committed by
Sebastien Robin
Jul 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
patches/DCWorkflow.py: patch variable showAsXML.
parent
8744401c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
product/ERP5Type/patches/DCWorkflow.py
product/ERP5Type/patches/DCWorkflow.py
+29
-0
No files found.
product/ERP5Type/patches/DCWorkflow.py
View file @
21ef5b95
...
...
@@ -997,6 +997,35 @@ def DCWorkflowDefinition_showAsXML(self, root=None):
property_type
=
transition_prop_id_to_show
[
property_id
]
sub_object
=
SubElement
(
transition
,
property_id
,
attrib
=
dict
(
type
=
property_type
))
sub_object
.
text
=
str
(
property_value
)
# 3. Variable as XML
variable_reference_list
=
[]
variable_id_list
=
sorted
(
self
.
variables
.
keys
())
variable_prop_id_to_show
=
{
'description'
:
'text'
,
'default_expr'
:
'string'
,
'for_catalog'
:
'int'
,
'for_status'
:
'int'
,
'update_always'
:
'int'
}
for
vid
in
variable_id_list
:
variable_reference_list
.
append
(
vid
)
variables
=
SubElement
(
workflow
,
'variables'
,
attrib
=
dict
(
variable_list
=
str
(
variable_reference_list
),
number_of_element
=
str
(
len
(
variable_reference_list
))))
for
vid
in
variable_id_list
:
vdef
=
self
.
variables
[
vid
]
variable
=
SubElement
(
variables
,
'variable'
,
attrib
=
dict
(
reference
=
vdef
.
getReference
(),
portal_type
=
'Variable'
))
for
property_id
in
sorted
(
variable_prop_id_to_show
):
if
property_id
==
'default_expr'
:
expression
=
getattr
(
vdef
,
property_id
,
None
)
if
expression
is
not
None
:
property_value
=
expression
.
text
else
:
property_value
=
''
sub_object
=
SubElement
(
variable
,
property_id
,
attrib
=
dict
(
type
=
'string'
))
else
:
property_value
=
vdef
.
__dict__
[
property_id
]
property_type
=
variable_prop_id_to_show
[
property_id
]
sub_object
=
SubElement
(
variable
,
property_id
,
attrib
=
dict
(
type
=
property_type
))
sub_object
.
text
=
str
(
property_value
)
# return xml object
if
return_as_object
:
return
root
...
...
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