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
9f2212cf
Commit
9f2212cf
authored
Dec 16, 2014
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5WorkflowMethod class created, correct all workflow5 indacation to ERP5Workflow.
parent
6dbab7ce
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
221 additions
and
97 deletions
+221
-97
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+197
-70
product/ERP5Type/ERP5Type.py
product/ERP5Type/ERP5Type.py
+7
-6
product/ERP5Type/dynamic/lazy_class.py
product/ERP5Type/dynamic/lazy_class.py
+7
-11
product/ERP5Workflow/Document/Workflow.py
product/ERP5Workflow/Document/Workflow.py
+10
-10
No files found.
product/ERP5Type/Base.py
View file @
9f2212cf
This diff is collapsed.
Click to expand it.
product/ERP5Type/ERP5Type.py
View file @
9f2212cf
...
...
@@ -418,13 +418,14 @@ class ERP5TypeInformation(XMLObject,
for
workflow
in
workflow_tool
.
getWorkflowsFor
(
ob
):
workflow
.
notifyCreated
(
ob
)
### Project WORKFLOW5 , WENJIE , 2014 ###
for
workflow5
in
self
.
getTypeWorkflowList
():
# =========== Project ERP5Workflow , WENJIE , 2014 ================================
### workflow_list need to be defined somewhere.
### exp: ERP5Workflow in Person module won't work at this situation.
for
ERP5Workflow
in
self
.
getTypeWorkflowList
():
workflow_module
=
portal
.
getDefaultModule
(
portal_type
=
"Workflow"
)
workflow5
=
workflow_module
.
_getOb
(
workflow5
)
workflow5
.
initializeDocument
(
ob
)
ERP5Workflow
=
workflow_module
.
_getOb
(
ERP5Workflow
)
ERP5Workflow
.
initializeDocument
(
ob
)
# =========== WF5 ==============================================================
if
not
temp_object
:
init_script
=
self
.
getTypeInitScriptId
()
...
...
product/ERP5Type/dynamic/lazy_class.py
View file @
9f2212cf
...
...
@@ -266,26 +266,22 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
else
:
initializePortalTypeDynamicWorkflowMethods
(
cls
,
portal_workflow
)
# ================== Workflow5 Project, Wenjie, Dec 2014 =======================
### the ERP5Workflow list is defined in ERP5Type, only try to get erp5workflow
### when it's an erp5workflow related type.
# ================== ERP5Workflow Project, Wenjie, Dec 2014 =======================
portal_type
=
site
.
getDefaultModule
(
portal_type
=
"portal_types"
)
### try to get workflow_list from related types then initialize the class of types
try
:
pt
=
portal_type
.
_getOb
(
cls
.
__name__
)
#raise NotImplemented (pt)
if
hasattr
(
pt
,
'workflow_list'
):
#if cls.__name__ == "Object Type": # Has to be redifined
portal_workflow5
=
site
.
getDefaultModule
(
portal_type
=
"Workflow"
)
#raise NotImplementedError (portal_workflow5) #<Workflow Module at workflow_module>
#raise NotImplementedError (cls.__module__) #<class 'erp5.portal_type.Category Property'>
if
portal_workflow5
is
None
:
### Get ERP5Workflow Module
portal_ERP5Workflow
=
site
.
getDefaultModule
(
portal_type
=
"Workflow"
)
if
portal_ERP5Workflow
is
None
:
LOG
(
"ERP5Type.Dynamic"
,
WARNING
,
"no
workflow5
methods for %s"
"no
ERP5Workflow
methods for %s"
%
cls
.
__name__
)
else
:
intializePortalTypeERP5WorkflowMethod
(
cls
,
portal_workflow5
)
### Generate Workflow Method
intializePortalTypeERP5WorkflowMethod
(
cls
,
portal_ERP5Workflow
)
except
:
pass
# ================== WF5 =======================================================
...
...
product/ERP5Workflow/Document/Workflow.py
View file @
9f2212cf
...
...
@@ -55,7 +55,7 @@ class Workflow(XMLObject):
isRADContent
=
1
### register the variable given by "base category value"
#state_var = 'state'
### In DCworkflow; state/transition can be registered inside workflow
### In DCworkflow; state/transition can be registered inside workflow
# Declarative security
security
=
ClassSecurityInfo
()
...
...
@@ -143,25 +143,25 @@ class Workflow(XMLObject):
transition
=
transition
,
transition_url
=
transition_url
,
state
=
state
)
# ==========
Workflow5
Project, Wenjie, Dec 2014 ===============================
def
is
Workflow5
MethodSupported
(
self
,
document
,
transition
):
s
tate
=
self
.
_getWorkflow5
StateOf
(
document
)
if
s
tate
is
None
:
# ==========
ERP5Workflow
Project, Wenjie, Dec 2014 ===============================
def
is
ERP5Workflow
MethodSupported
(
self
,
document
,
transition
):
s
def
=
self
.
_getERP5Workflow
StateOf
(
document
)
if
s
def
is
None
:
return
0
if
transition
in
s
tate
.
getDestinationValueList
():
if
transition
in
s
def
.
getDestinationValueList
():
return
1
return
0
### get workflow state from base category value:
def
_get
Workflow5
StateOf
(
self
,
ob
):
def
_get
ERP5Workflow
StateOf
(
self
,
ob
):
bc_id
=
self
.
getStateBaseCategory
()
state_path
=
ob
.
getCategoryList
()
state_path
=
state_path
[
0
].
lstrip
(
"%s/"
%
bc_id
)
###
if
state_path
is
not
None
:
s
tate
=
self
.
restrictedTraverse
(
state_path
)
else
:
s
tate
=
None
return
s
tate
s
def
=
self
.
restrictedTraverse
(
state_path
)
else
:
s
def
=
None
return
s
def
# =========== WF5 ==============================================================
###########
## Graph ##
...
...
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