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
43faaf31
Commit
43faaf31
authored
Jun 29, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow: rename variable default_expr to default_expression
parent
1b2aa5d6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
33 deletions
+19
-33
product/ERP5/bootstrap/erp5_property_sheets/PropertySheetTemplateItem/portal_property_sheets/Variable/default_expression_property.xml
..._property_sheets/Variable/default_expression_property.xml
+0
-0
product/ERP5Workflow/Document/InteractionWorkflow.py
product/ERP5Workflow/Document/InteractionWorkflow.py
+2
-2
product/ERP5Workflow/Document/Variable.py
product/ERP5Workflow/Document/Variable.py
+1
-8
product/ERP5Workflow/Document/Workflow.py
product/ERP5Workflow/Document/Workflow.py
+7
-7
product/ERP5Workflow/Document/Worklist.py
product/ERP5Workflow/Document/Worklist.py
+4
-4
product/ERP5Workflow/Document/WorklistVariable.py
product/ERP5Workflow/Document/WorklistVariable.py
+0
-7
product/ERP5Workflow/Tool/WorkflowTool.py
product/ERP5Workflow/Tool/WorkflowTool.py
+5
-5
No files found.
product/ERP5/bootstrap/erp5_property_sheets/PropertySheetTemplateItem/portal_property_sheets/Variable/default_expr_property.xml
→
product/ERP5/bootstrap/erp5_property_sheets/PropertySheetTemplateItem/portal_property_sheets/Variable/default_expr
ession
_property.xml
View file @
43faaf31
File moved
product/ERP5Workflow/Document/InteractionWorkflow.py
View file @
43faaf31
...
...
@@ -140,7 +140,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
getSecurityManager
(),
self
,
ob
):
return
default
status
=
self
.
_getStatusOf
(
ob
)
default_expr
=
vdef
.
getDefaultExpr
()
default_expr
=
vdef
.
getDefaultExpr
ession
()
if
status
is
not
None
and
name
in
status
:
value
=
status
[
name
]
# Not set yet. Use a default.
...
...
@@ -280,7 +280,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
# Preserve former value
value
=
former_status
[
id
]
else
:
default_expr
=
vdef
.
getDefaultExpr
()
default_expr
=
vdef
.
getDefaultExpr
ession
()
if
default_expr
is
not
None
:
expr
=
Expression
(
default_expr
)
else
:
...
...
product/ERP5Workflow/Document/Variable.py
View file @
43faaf31
...
...
@@ -66,13 +66,6 @@ class Variable(IdAsReferenceMixin("variable_", "prefix"), XMLObject):
PropertySheet
.
Variable
,
)
def
getDefaultExprText
(
self
):
default_expr
=
self
.
getDefaultExpr
()
if
not
default_expr
:
return
''
else
:
return
default_expr
def
getInfoGuardSummary
(
self
):
res
=
None
if
self
.
getGuard
()
is
not
None
:
...
...
@@ -99,4 +92,4 @@ class Variable(IdAsReferenceMixin("variable_", "prefix"), XMLObject):
if
self
.
getGroupList
()
is
not
None
:
self
.
info_guard
.
groups
=
self
.
getGroupList
()
if
self
.
getExpression
()
is
not
None
:
self
.
info_guard
.
expr
=
Expression
(
self
.
getExpression
())
\ No newline at end of file
self
.
info_guard
.
expr
=
Expression
(
self
.
getExpression
())
product/ERP5Workflow/Document/Workflow.py
View file @
43faaf31
...
...
@@ -429,7 +429,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
getSecurityManager
(),
self
,
ob
):
return
default
status
=
self
.
getCurrentStatusDict
(
ob
)
default_expr
=
vdef
.
getDefaultExpr
()
default_expr
=
vdef
.
getDefaultExpr
ession
()
if
status
is
not
None
and
status
.
has_key
(
name
):
value
=
status
[
name
]
...
...
@@ -647,7 +647,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
if
tdef
is
not
None
:
transition_variable_list
=
tdef
.
objectValues
(
portal_type
=
'Transition Variable'
)
for
transition_variable
in
transition_variable_list
:
tdef_exprs
[
transition_variable
.
getCausalityId
()]
=
transition_variable
.
getDefaultExpr
()
tdef_exprs
[
transition_variable
.
getCausalityId
()]
=
transition_variable
.
getDefaultExpr
ession
()
# Update all transition variables
if
form_kw
is
not
None
:
...
...
@@ -668,8 +668,8 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
# Preserve former value
value
=
former_status
[
variable_reference
]
else
:
if
vdef
.
getDefaultExpr
()
is
not
None
:
expr
=
vdef
.
getDefaultExpr
()
if
vdef
.
getDefaultExpr
ession
()
is
not
None
:
expr
=
vdef
.
getDefaultExpr
ession
()
else
:
value
=
vdef
.
getInitialValue
(
object
=
object
)
if
expr
is
not
None
and
expr
!=
''
:
...
...
@@ -895,7 +895,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
for
tr_var
in
tr_var_list
:
reference
=
self
.
_getOb
(
tr_var
.
getCausalityId
()).
getReference
()
transition_variable
=
SubElement
(
transition_variables
,
property_id
,
attrib
=
dict
(
id
=
reference
,
type
=
'variable'
))
transition_variable
.
text
=
str
(
tr_var
.
getDefaultExpr
())
transition_variable
.
text
=
str
(
tr_var
.
getDefaultExpr
ession
())
else
:
property_value
=
tdef
.
getProperty
(
property_id
)
property_type
=
tdef
.
getPropertyType
(
property_id
)
...
...
@@ -1068,7 +1068,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
# Preserve former value
value
=
former_status
[
id
]
else
:
default_expr
=
vdef
.
getDefaultExpr
()
default_expr
=
vdef
.
getDefaultExpr
ession
()
if
default_expr
is
not
None
:
expr
=
Expression
(
default_expr
)
else
:
...
...
@@ -1120,7 +1120,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
status
=
self
.
getCurrentStatusDict
(
ob
)
for
vdef_ref
,
vdef
in
self
.
getVariableValueDict
().
iteritems
():
if
vdef
.
getForCatalog
():
default_expr
=
vdef
.
getDefaultExpr
()
default_expr
=
vdef
.
getDefaultExpr
ession
()
if
status
.
has_key
(
vdef_ref
):
value
=
status
[
vdef_ref
]
...
...
product/ERP5Workflow/Document/Worklist.py
View file @
43faaf31
...
...
@@ -144,7 +144,7 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
variable_value_ref = variable_value.getReference()
worklist_variable_value = self.newContent(portal_type='
Worklist
Variable
')
worklist_variable_value.setReference(variable_value_ref)
worklist_variable_value.setDefaultExpr
(variable_value.getDefaultExpr
())
worklist_variable_value.setDefaultExpr
ession(variable_value.getDefaultExpression
())
worklist_variable_value.setInitialValue(variable_value.getInitialValue())
res.append(worklist_variable_value)
if worklist_variable_value and worklist_variable_value not in res and variable_value.getForCatalog() == 1:
...
...
@@ -174,7 +174,7 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
if self.getMatchedCausalityState() is not None:
key_list.append('
causality_state
')
for dynamic_variable in self.objectValues():
if dynamic_variable.getInitialValue() or dynamic_variable.getDefaultExpr():
if dynamic_variable.getInitialValue() or dynamic_variable.getDefaultExpr
ession
():
key_list.append(dynamic_variable.getReference())
return key_list
...
...
@@ -206,8 +206,8 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
if
dynamic_varible
.
getInitialValue
():
matches
=
[
dynamic_varible
.
getInitialValue
()]
# Override initial value if expression set:
if
dynamic_varible
.
getDefaultExpr
():
matches
=
Expression
(
dynamic_varible
.
getDefaultExpr
())
if
dynamic_varible
.
getDefaultExpr
ession
():
matches
=
Expression
(
dynamic_varible
.
getDefaultExpr
ession
())
if
matches
is
not
[]
and
matches
is
not
None
:
if
not
isinstance
(
matches
,
(
tuple
,
Expression
)):
...
...
product/ERP5Workflow/Document/WorklistVariable.py
View file @
43faaf31
...
...
@@ -64,10 +64,3 @@ class WorklistVariable(IdAsReferenceMixin("variable_", "prefix"), XMLObject):
PropertySheet
.
Reference
,
PropertySheet
.
Variable
,
)
def
getDefaultExprText
(
self
):
default_expr
=
self
.
getDefaultExpr
()
if
not
default_expr
:
return
''
else
:
return
default_expr
product/ERP5Workflow/Tool/WorkflowTool.py
View file @
43faaf31
...
...
@@ -411,7 +411,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
worklist_variable_value
=
worklist
.
newContent
(
portal_type
=
'Worklist Variable'
)
worklist_variable_value
.
setReference
(
key
)
if
isinstance
(
values
,
Expression
):
worklist_variable_value
.
setDefaultExpr
(
values
.
text
)
worklist_variable_value
.
setDefaultExpr
ession
(
values
.
text
)
else
:
worklist_variable_value
.
InitialValue
(
value
)
worklist
.
setActboxUrl
(
qdef
.
actbox_url
)
...
...
@@ -509,8 +509,8 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
# for a very specific case, action return the reference of transition
# in order to generation correct workflow history.
if
vid
==
'action'
:
variable
.
setDefaultExpr
(
'transition/getReference|nothing'
)
else
:
variable
.
setDefaultExpr
(
vdef
.
default_expr
.
text
)
variable
.
setDefaultExpr
ession
(
'transition/getReference|nothing'
)
else
:
variable
.
setDefaultExpr
ession
(
vdef
.
default_expr
.
text
)
if
vdef
.
info_guard
:
variable
.
info_guard
=
vdef
.
info_guard
variable
.
setRoleList
(
vdef
.
info_guard
.
roles
)
...
...
@@ -535,7 +535,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
else
:
var_exprs
=
origin_tdef
.
var_exprs
for
key
in
var_exprs
:
tr_var
=
transition
.
newContent
(
portal_type
=
'Transition Variable'
,
temp_object
=
temp
)
tr_var
.
setDefaultExpr
(
var_exprs
[
key
].
text
)
tr_var
.
setDefaultExpr
ession
(
var_exprs
[
key
].
text
)
tr_var_path
=
getattr
(
workflow
,
'variable_'
+
key
).
getPath
()
tr_var_path
=
'/'
.
join
(
tr_var_path
.
split
(
'/'
)[
2
:])
new_category
.
append
(
tr_var_path
)
...
...
@@ -552,7 +552,7 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
else
:
var_exprs
=
origin_tdef
.
var_exprs
for
key
in
var_exprs
:
tr_var
=
interaction
.
newContent
(
portal_type
=
'Transition Variable'
,
temp_object
=
temp
)
tr_var
.
setDefaultExpr
(
var_exprs
[
key
].
text
)
tr_var
.
setDefaultExpr
ession
(
var_exprs
[
key
].
text
)
tr_var_path
=
getattr
(
workflow
,
'variable_'
+
key
).
getPath
()
tr_var_path
=
'/'
.
join
(
tr_var_path
.
split
(
'/'
)[
2
:])
new_category
.
append
(
tr_var_path
)
...
...
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