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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastien Robin
erp5
Commits
61b4f638
Commit
61b4f638
authored
Jul 20, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow: rename initial_value to default_value
and dynamic_varible to dynamic_variable
parent
0cac150a
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
49 additions
and
48 deletions
+49
-48
bt5/erp5_configurator_maxma_demo/PathTemplateItem/workflow_module/maxma_demo_configuration_workflow/42.xml
.../workflow_module/maxma_demo_configuration_workflow/42.xml
+1
-1
bt5/erp5_configurator_maxma_demo/PathTemplateItem/workflow_module/maxma_demo_configuration_workflow/43.xml
.../workflow_module/maxma_demo_configuration_workflow/43.xml
+1
-1
bt5/erp5_configurator_maxma_demo/PathTemplateItem/workflow_module/maxma_demo_configuration_workflow/44.xml
.../workflow_module/maxma_demo_configuration_workflow/44.xml
+1
-1
bt5/erp5_configurator_maxma_demo/PathTemplateItem/workflow_module/maxma_demo_configuration_workflow/45.xml
.../workflow_module/maxma_demo_configuration_workflow/45.xml
+1
-1
bt5/erp5_configurator_maxma_demo/PathTemplateItem/workflow_module/maxma_demo_configuration_workflow/46.xml
.../workflow_module/maxma_demo_configuration_workflow/46.xml
+1
-1
bt5/erp5_configurator_maxma_demo/PathTemplateItem/workflow_module/maxma_demo_configuration_workflow/47.xml
.../workflow_module/maxma_demo_configuration_workflow/47.xml
+1
-1
bt5/erp5_configurator_maxma_demo/PathTemplateItem/workflow_module/maxma_demo_configuration_workflow/52.xml
.../workflow_module/maxma_demo_configuration_workflow/52.xml
+1
-1
bt5/erp5_configurator_maxma_demo/PathTemplateItem/workflow_module/maxma_demo_configuration_workflow/59.xml
.../workflow_module/maxma_demo_configuration_workflow/59.xml
+1
-1
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testWorklist.py
...tTemplateItem/portal_components/test.erp5.testWorklist.py
+1
-1
bt5/erp5_workflow/SkinTemplateItem/portal_skins/erp5_workflow/TransitionVariable_view.xml
...em/portal_skins/erp5_workflow/TransitionVariable_view.xml
+1
-1
bt5/erp5_workflow/SkinTemplateItem/portal_skins/erp5_workflow/TransitionVariable_view/my_default_value.xml
...rp5_workflow/TransitionVariable_view/my_default_value.xml
+1
-1
bt5/erp5_workflow/SkinTemplateItem/portal_skins/erp5_workflow/Variable_view.xml
...TemplateItem/portal_skins/erp5_workflow/Variable_view.xml
+1
-1
bt5/erp5_workflow/SkinTemplateItem/portal_skins/erp5_workflow/Variable_view/my_default_value.xml
...al_skins/erp5_workflow/Variable_view/my_default_value.xml
+1
-1
bt5/erp5_workflow/SkinTemplateItem/portal_skins/erp5_workflow/WorklistVariable_view.xml
...Item/portal_skins/erp5_workflow/WorklistVariable_view.xml
+1
-1
bt5/erp5_workflow/SkinTemplateItem/portal_skins/erp5_workflow/WorklistVariable_view/my_default_value.xml
.../erp5_workflow/WorklistVariable_view/my_default_value.xml
+1
-1
product/ERP5/bootstrap/erp5_property_sheets/PropertySheetTemplateItem/portal_property_sheets/Variable/default_value_property.xml
...ortal_property_sheets/Variable/default_value_property.xml
+1
-1
product/ERP5Workflow/Document/ConfigurationTransition.py
product/ERP5Workflow/Document/ConfigurationTransition.py
+2
-2
product/ERP5Workflow/Document/ConfigurationWorkflow.py
product/ERP5Workflow/Document/ConfigurationWorkflow.py
+1
-1
product/ERP5Workflow/Document/InteractionWorkflow.py
product/ERP5Workflow/Document/InteractionWorkflow.py
+5
-5
product/ERP5Workflow/Document/Workflow.py
product/ERP5Workflow/Document/Workflow.py
+7
-7
product/ERP5Workflow/Document/Worklist.py
product/ERP5Workflow/Document/Worklist.py
+7
-7
product/ERP5Workflow/Tool/WorkflowTool.py
product/ERP5Workflow/Tool/WorkflowTool.py
+11
-10
No files found.
bt5/erp5_configurator_maxma_demo/PathTemplateItem/workflow_module/maxma_demo_configuration_workflow/42.xml
View file @
61b4f638
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<value>
<string>
42
</string>
</value>
<value>
<string>
42
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
initial
_value
</string>
</key>
<key>
<string>
default
_value
</string>
</key>
<value>
<string>
python: member.getUserName()
</string>
</value>
<value>
<string>
python: member.getUserName()
</string>
</value>
</item>
</item>
<item>
<item>
...
...
bt5/erp5_configurator_maxma_demo/PathTemplateItem/workflow_module/maxma_demo_configuration_workflow/43.xml
View file @
61b4f638
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<value>
<string>
43
</string>
</value>
<value>
<string>
43
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
initial
_value
</string>
</key>
<key>
<string>
default
_value
</string>
</key>
<value>
<string>
python: object.getDateTime()
</string>
</value>
<value>
<string>
python: object.getDateTime()
</string>
</value>
</item>
</item>
<item>
<item>
...
...
bt5/erp5_configurator_maxma_demo/PathTemplateItem/workflow_module/maxma_demo_configuration_workflow/44.xml
View file @
61b4f638
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<value>
<string>
44
</string>
</value>
<value>
<string>
44
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
initial
_value
</string>
</key>
<key>
<string>
default
_value
</string>
</key>
<value>
<string>
python: None
</string>
</value>
<value>
<string>
python: None
</string>
</value>
</item>
</item>
<item>
<item>
...
...
bt5/erp5_configurator_maxma_demo/PathTemplateItem/workflow_module/maxma_demo_configuration_workflow/45.xml
View file @
61b4f638
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<value>
<string>
45
</string>
</value>
<value>
<string>
45
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
initial
_value
</string>
</key>
<key>
<string>
default
_value
</string>
</key>
<value>
<string>
python: None
</string>
</value>
<value>
<string>
python: None
</string>
</value>
</item>
</item>
<item>
<item>
...
...
bt5/erp5_configurator_maxma_demo/PathTemplateItem/workflow_module/maxma_demo_configuration_workflow/46.xml
View file @
61b4f638
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<value>
<string>
46
</string>
</value>
<value>
<string>
46
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
initial
_value
</string>
</key>
<key>
<string>
default
_value
</string>
</key>
<value>
<string>
python: request.get(\'configuration_save_url\', None)
</string>
</value>
<value>
<string>
python: request.get(\'configuration_save_url\', None)
</string>
</value>
</item>
</item>
<item>
<item>
...
...
bt5/erp5_configurator_maxma_demo/PathTemplateItem/workflow_module/maxma_demo_configuration_workflow/47.xml
View file @
61b4f638
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
<value>
<string>
47
</string>
</value>
<value>
<string>
47
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
initial
_value
</string>
</key>
<key>
<string>
default
_value
</string>
</key>
<value>
<value>
<none/>
<none/>
</value>
</value>
...
...
bt5/erp5_configurator_maxma_demo/PathTemplateItem/workflow_module/maxma_demo_configuration_workflow/52.xml
View file @
61b4f638
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
<value>
<string>
52
</string>
</value>
<value>
<string>
52
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
initial
_value
</string>
</key>
<key>
<string>
default
_value
</string>
</key>
<value>
<string>
python: request.get(\'client_id\', None)
</string>
</value>
<value>
<string>
python: request.get(\'client_id\', None)
</string>
</value>
</item>
</item>
<item>
<item>
...
...
bt5/erp5_configurator_maxma_demo/PathTemplateItem/workflow_module/maxma_demo_configuration_workflow/59.xml
View file @
61b4f638
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<value>
<string>
59
</string>
</value>
<value>
<string>
59
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
initial
_value
</string>
</key>
<key>
<string>
default
_value
</string>
</key>
<value>
<string>
python: request.get(\'transition\', None)
</string>
</value>
<value>
<string>
python: request.get(\'transition\', None)
</string>
</value>
</item>
</item>
<item>
<item>
...
...
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testWorklist.py
View file @
61b4f638
...
@@ -145,7 +145,7 @@ class TestWorklist(testWorkflowMixin):
...
@@ -145,7 +145,7 @@ class TestWorklist(testWorkflowMixin):
for
worklist_variable_key
,
worklist_variable_value
in
kw
.
iteritems
():
for
worklist_variable_key
,
worklist_variable_value
in
kw
.
iteritems
():
worklist_variable
=
worklist_value
.
newContent
(
portal_type
=
'Worklist Variable'
,
worklist_variable
=
worklist_value
.
newContent
(
portal_type
=
'Worklist Variable'
,
initial
_value
=
worklist_variable_value
,
default
_value
=
worklist_variable_value
,
reference
=
worklist_variable_key
)
reference
=
worklist_variable_key
)
if
isinstance
(
worklist_variable_value
,
str
)
and
worklist_variable_value
.
startswith
(
'python'
):
if
isinstance
(
worklist_variable_value
,
str
)
and
worklist_variable_value
.
startswith
(
'python'
):
worklist_variable
.
setDefaultExpression
(
worklist_variable_value
)
worklist_variable
.
setDefaultExpression
(
worklist_variable_value
)
...
...
bt5/erp5_workflow/SkinTemplateItem/portal_skins/erp5_workflow/TransitionVariable_view.xml
View file @
61b4f638
...
@@ -84,7 +84,7 @@
...
@@ -84,7 +84,7 @@
<value>
<value>
<list>
<list>
<string>
my_causality
</string>
<string>
my_causality
</string>
<string>
my_
initial
_value
</string>
<string>
my_
default
_value
</string>
<string>
my_default_expression
</string>
<string>
my_default_expression
</string>
</list>
</list>
</value>
</value>
...
...
bt5/erp5_workflow/SkinTemplateItem/portal_skins/erp5_workflow/TransitionVariable_view/my_
initial
_value.xml
→
bt5/erp5_workflow/SkinTemplateItem/portal_skins/erp5_workflow/TransitionVariable_view/my_
default
_value.xml
View file @
61b4f638
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<dictionary>
<dictionary>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_
initial
_value
</string>
</value>
<value>
<string>
my_
default
_value
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
message_values
</string>
</key>
<key>
<string>
message_values
</string>
</key>
...
...
bt5/erp5_workflow/SkinTemplateItem/portal_skins/erp5_workflow/Variable_view.xml
View file @
61b4f638
...
@@ -92,7 +92,7 @@
...
@@ -92,7 +92,7 @@
<string>
my_for_catalog
</string>
<string>
my_for_catalog
</string>
<string>
my_for_status
</string>
<string>
my_for_status
</string>
<string>
my_automatic_update
</string>
<string>
my_automatic_update
</string>
<string>
my_
initial
_value
</string>
<string>
my_
default
_value
</string>
<string>
my_default_expression
</string>
<string>
my_default_expression
</string>
</list>
</list>
</value>
</value>
...
...
bt5/erp5_workflow/SkinTemplateItem/portal_skins/erp5_workflow/Variable_view/my_
initial
_value.xml
→
bt5/erp5_workflow/SkinTemplateItem/portal_skins/erp5_workflow/Variable_view/my_
default
_value.xml
View file @
61b4f638
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<dictionary>
<dictionary>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_
initial
_value
</string>
</value>
<value>
<string>
my_
default
_value
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
message_values
</string>
</key>
<key>
<string>
message_values
</string>
</key>
...
...
bt5/erp5_workflow/SkinTemplateItem/portal_skins/erp5_workflow/WorklistVariable_view.xml
View file @
61b4f638
...
@@ -84,7 +84,7 @@
...
@@ -84,7 +84,7 @@
<value>
<value>
<list>
<list>
<string>
my_reference
</string>
<string>
my_reference
</string>
<string>
my_
initial
_value
</string>
<string>
my_
default
_value
</string>
<string>
my_default_expression
</string>
<string>
my_default_expression
</string>
</list>
</list>
</value>
</value>
...
...
bt5/erp5_workflow/SkinTemplateItem/portal_skins/erp5_workflow/WorklistVariable_view/my_
initial
_value.xml
→
bt5/erp5_workflow/SkinTemplateItem/portal_skins/erp5_workflow/WorklistVariable_view/my_
default
_value.xml
View file @
61b4f638
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<dictionary>
<dictionary>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_
initial
_value
</string>
</value>
<value>
<string>
my_
default
_value
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
message_values
</string>
</key>
<key>
<string>
message_values
</string>
</key>
...
...
product/ERP5/bootstrap/erp5_property_sheets/PropertySheetTemplateItem/portal_property_sheets/Variable/
initial
_value_property.xml
→
product/ERP5/bootstrap/erp5_property_sheets/PropertySheetTemplateItem/portal_property_sheets/Variable/
default
_value_property.xml
View file @
61b4f638
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
initial
_value_property
</string>
</value>
<value>
<string>
default
_value_property
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
mode
</string>
</key>
<key>
<string>
mode
</string>
</key>
...
...
product/ERP5Workflow/Document/ConfigurationTransition.py
View file @
61b4f638
...
@@ -87,13 +87,13 @@ class ConfigurationTransition(XMLObject):
...
@@ -87,13 +87,13 @@ class ConfigurationTransition(XMLObject):
if
variable_title
in
form_kw
:
if
variable_title
in
form_kw
:
status_dict
[
variable_title
]
=
form_kw
[
variable_title
]
status_dict
[
variable_title
]
=
form_kw
[
variable_title
]
else
:
else
:
status_dict
[
variable_title
]
=
variable
.
get
Initial
Value
(
object
=
object
)
status_dict
[
variable_title
]
=
variable
.
get
Default
Value
(
object
=
object
)
# Update all transition variables
# Update all transition variables
if
form_kw
is
not
None
:
if
form_kw
is
not
None
:
object
.
REQUEST
.
other
.
update
(
form_kw
)
object
.
REQUEST
.
other
.
update
(
form_kw
)
for
variable
in
self
.
contentValues
(
portal_type
=
'Transition Variable'
):
for
variable
in
self
.
contentValues
(
portal_type
=
'Transition Variable'
):
status_dict
[
variable
.
getCausalityTitle
()]
=
variable
.
get
Initial
Value
(
object
=
object
)
status_dict
[
variable
.
getCausalityTitle
()]
=
variable
.
get
Default
Value
(
object
=
object
)
workflow
.
_updateWorkflowHistory
(
document
,
status_dict
)
workflow
.
_updateWorkflowHistory
(
document
,
status_dict
)
...
...
product/ERP5Workflow/Document/ConfigurationWorkflow.py
View file @
61b4f638
...
@@ -78,7 +78,7 @@ class ConfigurationWorkflow(XMLObject):
...
@@ -78,7 +78,7 @@ class ConfigurationWorkflow(XMLObject):
status_dict
=
{
state_bc_id
:
self
.
getSource
()}
status_dict
=
{
state_bc_id
:
self
.
getSource
()}
variable_list
=
self
.
contentValues
(
portal_type
=
'Variable'
)
variable_list
=
self
.
contentValues
(
portal_type
=
'Variable'
)
for
variable
in
variable_list
:
for
variable
in
variable_list
:
status_dict
[
variable
.
getTitle
()]
=
variable
.
get
Initial
Value
(
object
=
object
)
status_dict
[
variable
.
getTitle
()]
=
variable
.
get
Default
Value
(
object
=
object
)
self
.
_updateWorkflowHistory
(
document
,
status_dict
)
self
.
_updateWorkflowHistory
(
document
,
status_dict
)
def
_generateHistoryKey
(
self
):
def
_generateHistoryKey
(
self
):
...
...
product/ERP5Workflow/Document/InteractionWorkflow.py
View file @
61b4f638
...
@@ -148,7 +148,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
...
@@ -148,7 +148,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
ec
=
createExprContext
(
StateChangeInfo
(
ob
,
self
,
status
))
ec
=
createExprContext
(
StateChangeInfo
(
ob
,
self
,
status
))
value
=
Expression
(
default_expression
)(
ec
)
value
=
Expression
(
default_expression
)(
ec
)
else
:
else
:
value
=
vdef
.
get
Initial
Value
()
value
=
vdef
.
get
Default
Value
()
return
value
return
value
...
@@ -290,7 +290,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
...
@@ -290,7 +290,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
if
default_expression
is
not
None
:
if
default_expression
is
not
None
:
expression
=
Expression
(
default_expression
)
expression
=
Expression
(
default_expression
)
else
:
else
:
value
=
vdef
.
get
Initial
Value
()
value
=
vdef
.
get
Default
Value
()
if
expression
is
not
None
:
if
expression
is
not
None
:
# Evaluate an expression.
# Evaluate an expression.
if
econtext
is
None
:
if
econtext
is
None
:
...
@@ -482,9 +482,9 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
...
@@ -482,9 +482,9 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
property_value
=
vdef
.
getAutomaticUpdate
()
property_value
=
vdef
.
getAutomaticUpdate
()
sub_object
=
SubElement
(
variable
,
property_id
,
attrib
=
dict
(
type
=
'int'
))
sub_object
=
SubElement
(
variable
,
property_id
,
attrib
=
dict
(
type
=
'int'
))
elif
property_id
==
'default_value'
:
elif
property_id
==
'default_value'
:
property_value
=
vdef
.
get
Initial
Value
()
property_value
=
vdef
.
get
Default
Value
()
if
vdef
.
get
Initial
Value
()
is
not
None
:
if
vdef
.
get
Default
Value
()
is
not
None
:
property_value
=
vdef
.
get
Initial
Value
()
property_value
=
vdef
.
get
Default
Value
()
sub_object
=
SubElement
(
variable
,
property_id
,
attrib
=
dict
(
type
=
'string'
))
sub_object
=
SubElement
(
variable
,
property_id
,
attrib
=
dict
(
type
=
'string'
))
else
:
else
:
property_value
=
vdef
.
getProperty
(
property_id
)
property_value
=
vdef
.
getProperty
(
property_id
)
...
...
product/ERP5Workflow/Document/Workflow.py
View file @
61b4f638
...
@@ -439,7 +439,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
...
@@ -439,7 +439,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
ec
=
createExprContext
(
StateChangeInfo
(
ob
,
self
,
status
))
ec
=
createExprContext
(
StateChangeInfo
(
ob
,
self
,
status
))
value
=
Expression
(
default_expression
)(
ec
)
value
=
Expression
(
default_expression
)(
ec
)
else
:
else
:
value
=
vdef
.
get
Initial
Value
()
value
=
vdef
.
get
Default
Value
()
return
value
return
value
...
@@ -664,7 +664,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
...
@@ -664,7 +664,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
if
vdef
.
getDefaultExpression
()
is
not
None
:
if
vdef
.
getDefaultExpression
()
is
not
None
:
expr
=
vdef
.
getDefaultExpression
()
expr
=
vdef
.
getDefaultExpression
()
else
:
else
:
value
=
vdef
.
get
Initial
Value
(
object
=
object
)
value
=
vdef
.
get
Default
Value
(
object
=
object
)
if
expr
is
not
None
and
expr
!=
''
:
if
expr
is
not
None
and
expr
!=
''
:
# Evaluate an expression.
# Evaluate an expression.
if
econtext
is
None
:
if
econtext
is
None
:
...
@@ -914,9 +914,9 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
...
@@ -914,9 +914,9 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
property_value
=
vdef
.
getAutomaticUpdate
()
property_value
=
vdef
.
getAutomaticUpdate
()
sub_object
=
SubElement
(
variable
,
property_id
,
attrib
=
dict
(
type
=
'int'
))
sub_object
=
SubElement
(
variable
,
property_id
,
attrib
=
dict
(
type
=
'int'
))
elif
property_id
==
'default_value'
:
elif
property_id
==
'default_value'
:
property_value
=
vdef
.
get
Initial
Value
()
property_value
=
vdef
.
get
Default
Value
()
if
vdef
.
get
Initial
Value
()
is
not
None
:
if
vdef
.
get
Default
Value
()
is
not
None
:
property_value
=
vdef
.
get
Initial
Value
()
property_value
=
vdef
.
get
Default
Value
()
sub_object
=
SubElement
(
variable
,
property_id
,
attrib
=
dict
(
type
=
'string'
))
sub_object
=
SubElement
(
variable
,
property_id
,
attrib
=
dict
(
type
=
'string'
))
else
:
else
:
property_value
=
vdef
.
getProperty
(
property_id
)
property_value
=
vdef
.
getProperty
(
property_id
)
...
@@ -1065,7 +1065,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
...
@@ -1065,7 +1065,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
if
default_expression
is
not
None
:
if
default_expression
is
not
None
:
expr
=
Expression
(
default_expression
)
expr
=
Expression
(
default_expression
)
else
:
else
:
value
=
vdef
.
get
Initial
Value
()
value
=
vdef
.
get
Default
Value
()
if
expr
is
not
None
:
if
expr
is
not
None
:
# Evaluate an expression.
# Evaluate an expression.
if
econtext
is
None
:
if
econtext
is
None
:
...
@@ -1123,7 +1123,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
...
@@ -1123,7 +1123,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
# convert string to expression before execute it.
# convert string to expression before execute it.
value
=
Expression
(
default_expression
)(
ec
)
value
=
Expression
(
default_expression
)(
ec
)
else
:
else
:
value
=
vdef
.
get
Initial
Value
()
value
=
vdef
.
get
Default
Value
()
if
hasattr
(
self
,
'getSourceValue'
):
if
hasattr
(
self
,
'getSourceValue'
):
if
self
.
getSourceValue
()
is
not
None
:
if
self
.
getSourceValue
()
is
not
None
:
initial_state
=
self
.
getSourceValue
().
getReference
()
initial_state
=
self
.
getSourceValue
().
getReference
()
...
...
product/ERP5Workflow/Document/Worklist.py
View file @
61b4f638
...
@@ -145,7 +145,7 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
...
@@ -145,7 +145,7 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
worklist_variable_value = self.newContent(portal_type='
Worklist
Variable
')
worklist_variable_value = self.newContent(portal_type='
Worklist
Variable
')
worklist_variable_value.setReference(variable_value_ref)
worklist_variable_value.setReference(variable_value_ref)
worklist_variable_value.setDefaultExpression(variable_value.getDefaultExpression())
worklist_variable_value.setDefaultExpression(variable_value.getDefaultExpression())
worklist_variable_value.set
InitialValue(variable_value.getInitial
Value())
worklist_variable_value.set
DefaultValue(variable_value.getDefault
Value())
res.append(worklist_variable_value)
res.append(worklist_variable_value)
if worklist_variable_value and worklist_variable_value not in res and variable_value.getForCatalog() == 1:
if worklist_variable_value and worklist_variable_value not in res and variable_value.getForCatalog() == 1:
res.append(worklist_variable_value)
res.append(worklist_variable_value)
...
@@ -174,7 +174,7 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
...
@@ -174,7 +174,7 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
if self.getMatchedCausalityState() is not None:
if self.getMatchedCausalityState() is not None:
key_list.append('
causality_state
')
key_list.append('
causality_state
')
for dynamic_variable in self.objectValues():
for dynamic_variable in self.objectValues():
if dynamic_variable.get
Initial
Value() or dynamic_variable.getDefaultExpression():
if dynamic_variable.get
Default
Value() or dynamic_variable.getDefaultExpression():
key_list.append(dynamic_variable.getReference())
key_list.append(dynamic_variable.getReference())
return key_list
return key_list
...
@@ -202,12 +202,12 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
...
@@ -202,12 +202,12 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
matches
=
tuple
(
matches_ref_list
)
matches
=
tuple
(
matches_ref_list
)
elif
id
:
elif
id
:
# Local dynamic variable:
# Local dynamic variable:
dynamic_varible
=
self
.
_getOb
(
'variable_'
+
id
)
dynamic_vari
a
ble
=
self
.
_getOb
(
'variable_'
+
id
)
if
dynamic_vari
ble
.
getInitial
Value
():
if
dynamic_vari
able
.
getDefault
Value
():
matches
=
[
dynamic_vari
ble
.
getInitial
Value
()]
matches
=
[
dynamic_vari
able
.
getDefault
Value
()]
# Override initial value if expression set:
# Override initial value if expression set:
if
dynamic_varible
.
getDefaultExpression
():
if
dynamic_vari
a
ble
.
getDefaultExpression
():
matches
=
Expression
(
dynamic_varible
.
getDefaultExpression
())
matches
=
Expression
(
dynamic_vari
a
ble
.
getDefaultExpression
())
if
matches
is
not
[]
and
matches
is
not
None
:
if
matches
is
not
[]
and
matches
is
not
None
:
if
not
isinstance
(
matches
,
(
tuple
,
Expression
)):
if
not
isinstance
(
matches
,
(
tuple
,
Expression
)):
...
...
product/ERP5Workflow/Tool/WorkflowTool.py
View file @
61b4f638
...
@@ -405,12 +405,13 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -405,12 +405,13 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
worklist
.
setMatchedCausalityState
(
state_id
)
worklist
.
setMatchedCausalityState
(
state_id
)
else
:
else
:
# dynamic variable.
# dynamic variable.
worklist_variable_value
=
worklist
.
newContent
(
portal_type
=
'Worklist Variable'
)
worklist_variable_value
=
worklist
.
newContent
(
portal_type
=
'Worklist Variable'
,
worklist_variable_value
.
setReference
(
key
)
reference
=
key
)
if
isinstance
(
values
,
Expression
):
if
isinstance
(
values
,
Expression
):
worklist_variable_value
.
setDefaultExpression
(
values
.
text
)
worklist_variable_value
.
setDefaultExpression
(
values
.
text
)
else
:
else
:
worklist_variable_value
.
InitialValue
(
value
)
worklist_variable_value
.
setDefaultValue
(
values
)
worklist
.
setActboxUrl
(
qdef
.
actbox_url
)
worklist
.
setActboxUrl
(
qdef
.
actbox_url
)
worklist
.
setActboxCategory
(
qdef
.
actbox_category
)
worklist
.
setActboxCategory
(
qdef
.
actbox_category
)
worklist
.
setActboxIcon
(
qdef
.
actbox_icon
)
worklist
.
setActboxIcon
(
qdef
.
actbox_icon
)
...
@@ -503,8 +504,6 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -503,8 +504,6 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
if
getattr
(
variable_definition
,
'default_expr'
,
None
)
is
not
None
:
if
getattr
(
variable_definition
,
'default_expr'
,
None
)
is
not
None
:
# for a very specific case, action return the reference of transition
# for a very specific case, action return the reference of transition
# in order to generation correct workflow history.
# in order to generation correct workflow history.
LOG
(
"### workflow:"
,
INFO
,
workflow
)
LOG
(
"### variable_definition:"
,
INFO
,
variable_definition
)
if
variable_id
==
'action'
:
if
variable_id
==
'action'
:
variable
.
setDefaultExpression
(
'transition/getReference|nothing'
)
variable
.
setDefaultExpression
(
'transition/getReference|nothing'
)
else
:
else
:
...
@@ -519,7 +518,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -519,7 +518,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
variable
.
setExpression
(
tdef
.
info_guard
.
expr
.
text
)
variable
.
setExpression
(
tdef
.
info_guard
.
expr
.
text
)
variable
.
setForCatalog
(
variable_definition
.
for_catalog
)
variable
.
setForCatalog
(
variable_definition
.
for_catalog
)
variable
.
setForStatus
(
variable_definition
.
for_status
)
variable
.
setForStatus
(
variable_definition
.
for_status
)
variable
.
set
Initial
Value
(
variable_definition
.
default_value
)
variable
.
set
Default
Value
(
variable_definition
.
default_value
)
variable
.
setDescription
(
variable_definition
.
description
)
variable
.
setDescription
(
variable_definition
.
description
)
# Configure transition variable:
# Configure transition variable:
if
getattr
(
dc_workflow
,
'transitions'
,
None
)
is
not
None
:
if
getattr
(
dc_workflow
,
'transitions'
,
None
)
is
not
None
:
...
@@ -1111,8 +1110,10 @@ def groupWorklistListByCondition(worklist_dict, sql_catalog, getSecurityUidDictA
...
@@ -1111,8 +1110,10 @@ def groupWorklistListByCondition(worklist_dict, sql_catalog, getSecurityUidDictA
# One entry per worklist group, based on filter criterions.
# One entry per worklist group, based on filter criterions.
worklist_set_dict
=
{}
worklist_set_dict
=
{}
metadata_dict
=
{}
metadata_dict
=
{}
for
workflow_id
,
worklist
in
worklist_dict
.
iteritems
():
for
workflow_id
,
worklist
in
worklist_dict
.
iteritems
():
for
worklist_id
,
worklist_match_dict
in
worklist
.
iteritems
():
for
worklist_id
,
worklist_match_dict
in
worklist
.
iteritems
():
# creates keys for new 'metadata' dict
workflow_worklist_key
=
'/'
.
join
((
workflow_id
,
worklist_id
))
workflow_worklist_key
=
'/'
.
join
((
workflow_id
,
worklist_id
))
if
getSecurityUidDictAndRoleColumnDict
is
None
:
if
getSecurityUidDictAndRoleColumnDict
is
None
:
valid_criterion_dict
,
metadata
=
getValidCriterionDict
(
valid_criterion_dict
,
metadata
=
getValidCriterionDict
(
...
@@ -1167,6 +1168,7 @@ def groupWorklistListByCondition(worklist_dict, sql_catalog, getSecurityUidDictA
...
@@ -1167,6 +1168,7 @@ def groupWorklistListByCondition(worklist_dict, sql_catalog, getSecurityUidDictA
worklist_set_dict
=
worklist_set_dict
,
worklist_set_dict
=
worklist_set_dict
,
workflow_worklist_key
=
workflow_worklist_key
,
workflow_worklist_key
=
workflow_worklist_key
,
valid_criterion_dict
=
valid_criterion_dict
)
valid_criterion_dict
=
valid_criterion_dict
)
return
worklist_set_dict
.
values
(),
metadata_dict
return
worklist_set_dict
.
values
(),
metadata_dict
def
generateNestedQuery
(
getQuery
,
priority_list
,
criterion_dict
,
possible_worklist_id_dict
=
None
):
def
generateNestedQuery
(
getQuery
,
priority_list
,
criterion_dict
,
possible_worklist_id_dict
=
None
):
...
@@ -1281,16 +1283,15 @@ def generateActionList(worklist_metadata, worklist_result, portal_url):
...
@@ -1281,16 +1283,15 @@ def generateActionList(worklist_metadata, worklist_result, portal_url):
"""
"""
action_list
=
[]
action_list
=
[]
append
=
action_list
.
append
append
=
action_list
.
append
for
key
,
metadata
in
worklist_metadata
.
iteritems
():
for
key
,
metadata
in
worklist_metadata
.
iteritems
():
document_count
=
worklist_result
.
get
(
key
,
0
)
document_count
=
worklist_result
.
get
(
key
,
0
)
if
document_count
:
if
document_count
:
format_data
=
metadata
[
'format_data'
]
format_data
=
metadata
[
'format_data'
]
format_data
.
_push
({
'count'
:
document_count
})
format_data
.
_push
({
'count'
:
document_count
})
append
({
'name'
:
metadata
[
'worklist_title'
]
%
format_data
,
append
({
'name'
:
metadata
[
'worklist_title'
]
%
format_data
,
'url'
:
portal_url
if
not
metadata
[
'action_box_url'
]
else
\
'url'
:
'%s/%s'
%
(
portal_url
,
'%s/%s'
%
(
portal_url
,
metadata
[
'action_box_url'
]
or
''
%
format_data
),
#DCWorkflow were returning string 'None'
metadata
[
'action_box_url'
]
%
format_data
),
'worklist_id'
:
metadata
[
'worklist_id'
],
'worklist_id'
:
metadata
[
'worklist_id'
],
'workflow_title'
:
metadata
[
'workflow_title'
],
'workflow_title'
:
metadata
[
'workflow_title'
],
'workflow_id'
:
metadata
[
'workflow_id'
],
'workflow_id'
:
metadata
[
'workflow_id'
],
...
...
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