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
Bryan Kaperick
erp5
Commits
22b179f3
Commit
22b179f3
authored
Jul 31, 2015
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Variable.py: remove setProperties which can be replace by edit.
parent
5613e596
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
26 deletions
+54
-26
bt5/erp5_workflow/SkinTemplateItem/portal_skins/erp5_workflow/Workflow_init.xml
...TemplateItem/portal_skins/erp5_workflow/Workflow_init.xml
+52
-1
product/ERP5Workflow/Document/Variable.py
product/ERP5Workflow/Document/Variable.py
+2
-25
No files found.
bt5/erp5_workflow/SkinTemplateItem/portal_skins/erp5_workflow/Workflow_init.xml
View file @
22b179f3
...
...
@@ -50,7 +50,58 @@
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
context.initialDefaultWorkflow()\n
<value>
<string>
"""Sets up an Workflow with defaults variables needed by ERP5.\n
"""\n
for state_id, state_title in ((\'draft\', \'Draft\'),):\n
state = context.newContent(portal_type=\'State\')\n
state.setReference(state_id)\n
state.setTitle(state_title)\n
context.setSourceValue(state)\n
\n
for v, property_dict in (\n
(\'action\', {\n
\'description\': \'Transition id\',\n
\'default_expr\': \'transition/getReference|nothing\',\n
\'for_status\': 1,\n
\'automatic_update\': 1,\n
}),\n
(\'actor\', {\n
\'description\': \'Name of the user who performed transition\',\n
\'default_expr\': \'user/getUserName\',\n
\'for_status\': 1,\n
\'automatic_update\': 1,\n
}),\n
(\'comment\', {\n
\'description\': \'Comment about transition\',\n
\'default_expr\': "python:state_change.kwargs.get(\'comment\', \'\')",\n
\'for_status\': 1,\n
\'automatic_update\': 1,\n
}),\n
(\'history\', {\n
\'description\': \'Provides access to workflow history\',\n
\'default_expr\': \'state_change/getHistory\',\n
}),\n
(\'time\', {\n
\'description\': \'Transition timestamp\',\n
\'default_expr\': \'state_change/getDateTime\',\n
\'for_status\': 1,\n
\'automatic_update\': 1,\n
}),\n
(\'error_message\', {\n
\'description\': \'Error message if validation failed\',\n
\'for_status\': 1,\n
\'automatic_update\': 1,\n
}),\n
(\'portal_type\', {\n
\'description\': \'Portal type (used as filter for worklists)\',\n
\'for_catalog\': 1,\n
}),\n
):\n
variable = context.newContent(portal_type=\'Variable\')\n
variable.setReference(v)\n
variable.edit(**property_dict)\n
\n
context.setStateVariable(\'simulation_state\')\n
</string>
</value>
</item>
<item>
...
...
product/ERP5Workflow/Document/Variable.py
View file @
22b179f3
...
...
@@ -91,34 +91,11 @@ class Variable(IdAsReferenceMixin("variable_", "prefix"), XMLObject):
def
getInfoGuard
(
self
):
if
self
.
info_guard
is
not
None
:
self
.
generateGuard
()
self
.
generate
Info
Guard
()
return
self
.
info_guard
def
getInfoGuardSummary
(
self
):
res
=
None
if
self
.
info_guard
is
not
None
:
res
=
self
.
info_guard
.
getSummary
()
return
res
# initial pre-configured workflow's variables
def
setProperties
(
self
,
description
,
default_value
=
''
,
default_expr
=
''
,
for_catalog
=
0
,
for_status
=
0
,
update_always
=
0
,
props
=
None
,
REQUEST
=
None
):
self
.
setDescription
(
str
(
description
))
self
.
setInitialValue
(
str
(
default_value
))
if
default_expr
:
self
.
setDefaultExpr
(
default_expr
)
else
:
self
.
default_expr
=
None
g
=
Guard
()
if
g
.
changeFromProperties
(
props
or
REQUEST
):
self
.
info_guard
=
g
else
:
self
.
info_guard
=
None
self
.
setForCatalog
(
bool
(
for_catalog
))
self
.
setForStatus
(
bool
(
for_status
))
self
.
setAutomaticUpdate
(
bool
(
update_always
))
if
REQUEST
is
not
None
:
return
self
.
manage_properties
(
REQUEST
,
'Properties changed.'
)
return
res
\ No newline at end of file
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