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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Iliya Manolov
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,
...
@@ -418,13 +418,14 @@ class ERP5TypeInformation(XMLObject,
for
workflow
in
workflow_tool
.
getWorkflowsFor
(
ob
):
for
workflow
in
workflow_tool
.
getWorkflowsFor
(
ob
):
workflow
.
notifyCreated
(
ob
)
workflow
.
notifyCreated
(
ob
)
### Project WORKFLOW5 , WENJIE , 2014 ###
# =========== Project ERP5Workflow , WENJIE , 2014 ================================
### workflow_list need to be defined somewhere.
for
workflow5
in
self
.
getTypeWorkflowList
():
### exp: ERP5Workflow in Person module won't work at this situation.
for
ERP5Workflow
in
self
.
getTypeWorkflowList
():
workflow_module
=
portal
.
getDefaultModule
(
portal_type
=
"Workflow"
)
workflow_module
=
portal
.
getDefaultModule
(
portal_type
=
"Workflow"
)
workflow5
=
workflow_module
.
_getOb
(
workflow5
)
ERP5Workflow
=
workflow_module
.
_getOb
(
ERP5Workflow
)
workflow5
.
initializeDocument
(
ob
)
ERP5Workflow
.
initializeDocument
(
ob
)
# =========== WF5 ==============================================================
if
not
temp_object
:
if
not
temp_object
:
init_script
=
self
.
getTypeInitScriptId
()
init_script
=
self
.
getTypeInitScriptId
()
...
...
product/ERP5Type/dynamic/lazy_class.py
View file @
9f2212cf
...
@@ -266,26 +266,22 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
...
@@ -266,26 +266,22 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
else
:
else
:
initializePortalTypeDynamicWorkflowMethods
(
cls
,
portal_workflow
)
initializePortalTypeDynamicWorkflowMethods
(
cls
,
portal_workflow
)
# ================== Workflow5 Project, Wenjie, Dec 2014 =======================
# ================== ERP5Workflow Project, Wenjie, Dec 2014 =======================
### the ERP5Workflow list is defined in ERP5Type, only try to get erp5workflow
### when it's an erp5workflow related type.
portal_type
=
site
.
getDefaultModule
(
portal_type
=
"portal_types"
)
portal_type
=
site
.
getDefaultModule
(
portal_type
=
"portal_types"
)
### try to get workflow_list from related types then initialize the class of types
### try to get workflow_list from related types then initialize the class of types
try
:
try
:
pt
=
portal_type
.
_getOb
(
cls
.
__name__
)
pt
=
portal_type
.
_getOb
(
cls
.
__name__
)
#raise NotImplemented (pt)
#raise NotImplemented (pt)
if
hasattr
(
pt
,
'workflow_list'
):
if
hasattr
(
pt
,
'workflow_list'
):
#if cls.__name__ == "Object Type": # Has to be redifined
### Get ERP5Workflow Module
portal_workflow5
=
site
.
getDefaultModule
(
portal_type
=
"Workflow"
)
portal_ERP5Workflow
=
site
.
getDefaultModule
(
portal_type
=
"Workflow"
)
#raise NotImplementedError (portal_workflow5) #<Workflow Module at workflow_module>
if
portal_ERP5Workflow
is
None
:
#raise NotImplementedError (cls.__module__) #<class 'erp5.portal_type.Category Property'>
if
portal_workflow5
is
None
:
LOG
(
"ERP5Type.Dynamic"
,
WARNING
,
LOG
(
"ERP5Type.Dynamic"
,
WARNING
,
"no
workflow5
methods for %s"
"no
ERP5Workflow
methods for %s"
%
cls
.
__name__
)
%
cls
.
__name__
)
else
:
else
:
intializePortalTypeERP5WorkflowMethod
(
cls
,
portal_workflow5
)
### Generate Workflow Method
intializePortalTypeERP5WorkflowMethod
(
cls
,
portal_ERP5Workflow
)
except
:
except
:
pass
pass
# ================== WF5 =======================================================
# ================== WF5 =======================================================
...
...
product/ERP5Workflow/Document/Workflow.py
View file @
9f2212cf
...
@@ -55,7 +55,7 @@ class Workflow(XMLObject):
...
@@ -55,7 +55,7 @@ class Workflow(XMLObject):
isRADContent
=
1
isRADContent
=
1
### register the variable given by "base category value"
### register the variable given by "base category value"
#state_var = 'state'
#state_var = 'state'
### In DCworkflow; state/transition can be registered inside workflow
### In DCworkflow; state/transition can be registered inside workflow
# Declarative security
# Declarative security
security
=
ClassSecurityInfo
()
security
=
ClassSecurityInfo
()
...
@@ -143,25 +143,25 @@ class Workflow(XMLObject):
...
@@ -143,25 +143,25 @@ class Workflow(XMLObject):
transition
=
transition
,
transition
=
transition
,
transition_url
=
transition_url
,
transition_url
=
transition_url
,
state
=
state
)
state
=
state
)
# ==========
Workflow5
Project, Wenjie, Dec 2014 ===============================
# ==========
ERP5Workflow
Project, Wenjie, Dec 2014 ===============================
def
is
Workflow5
MethodSupported
(
self
,
document
,
transition
):
def
is
ERP5Workflow
MethodSupported
(
self
,
document
,
transition
):
s
tate
=
self
.
_getWorkflow5
StateOf
(
document
)
s
def
=
self
.
_getERP5Workflow
StateOf
(
document
)
if
s
tate
is
None
:
if
s
def
is
None
:
return
0
return
0
if
transition
in
s
tate
.
getDestinationValueList
():
if
transition
in
s
def
.
getDestinationValueList
():
return
1
return
1
return
0
return
0
### get workflow state from base category value:
### get workflow state from base category value:
def
_get
Workflow5
StateOf
(
self
,
ob
):
def
_get
ERP5Workflow
StateOf
(
self
,
ob
):
bc_id
=
self
.
getStateBaseCategory
()
bc_id
=
self
.
getStateBaseCategory
()
state_path
=
ob
.
getCategoryList
()
state_path
=
ob
.
getCategoryList
()
state_path
=
state_path
[
0
].
lstrip
(
"%s/"
%
bc_id
)
state_path
=
state_path
[
0
].
lstrip
(
"%s/"
%
bc_id
)
###
###
if
state_path
is
not
None
:
if
state_path
is
not
None
:
s
tate
=
self
.
restrictedTraverse
(
state_path
)
s
def
=
self
.
restrictedTraverse
(
state_path
)
else
:
s
tate
=
None
else
:
s
def
=
None
return
s
tate
return
s
def
# =========== WF5 ==============================================================
# =========== WF5 ==============================================================
###########
###########
## Graph ##
## 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