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
Eteri
erp5
Commits
3bcb3ef5
Commit
3bcb3ef5
authored
Dec 16, 2014
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workflow and Base: Fix new line marker from code mirror.
parent
d8c7e3f9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
12 deletions
+3
-12
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+3
-6
product/ERP5Workflow/Document/Workflow.py
product/ERP5Workflow/Document/Workflow.py
+0
-6
No files found.
product/ERP5Type/Base.py
View file @
3bcb3ef5
...
@@ -109,7 +109,7 @@ _MARKER = []
...
@@ -109,7 +109,7 @@ _MARKER = []
global
registered_workflow_method_set
global
registered_workflow_method_set
wildcard_interaction_method_id_match
=
re
.
compile
(
r'[[.?*+{(\\]'
).
search
wildcard_interaction_method_id_match
=
re
.
compile
(
r'[[.?*+{(\\]'
).
search
workflow_method_registry
=
[]
# XXX A set() would be better but would require a hash in WorkflowMethod class
workflow_method_registry
=
[]
# XXX A set() would be better but would require a hash in WorkflowMethod class
erp5workflow_method_registry
=
[]
erp5workflow_method_registry
=
[]
def
resetRegisteredWorkflowMethod
(
portal_type
=
None
):
def
resetRegisteredWorkflowMethod
(
portal_type
=
None
):
"""
"""
...
@@ -213,12 +213,9 @@ class ERP5WorkflowMethod(Method):
...
@@ -213,12 +213,9 @@ class ERP5WorkflowMethod(Method):
valid_list
=
[]
valid_list
=
[]
for
transition_id
in
transition_list
:
for
transition_id
in
transition_list
:
if
wf5_module
.
_getOb
(
wf_id
).
isERP5WorkflowMethodSupported
(
instance
,
wf5_module
.
_getOb
(
wf_id
).
_getOb
(
transition_id
)):
if
wf5_module
.
_getOb
(
wf_id
).
isERP5WorkflowMethodSupported
(
instance
,
wf5_module
.
_getOb
(
wf_id
).
_getOb
(
transition_id
)):
#if wf5_module._getOb(wf_id)._getOb(transition_id) in instance.getCategoryStateValue().getDestinationValueList():
valid_list
.
append
(
transition_id
)
valid_list
.
append
(
transition_id
)
once_transition_key
=
once_transition_dict
.
get
((
wf_id
,
transition_id
))
once_transition_key
=
once_transition_dict
.
get
((
wf_id
,
transition_id
))
transactional_variable
[
once_transition_key
]
=
1
transactional_variable
[
once_transition_key
]
=
1
#else: ### don't do anything if no supported
#raise UnsupportedWorkflowMethod(instance, wf_id, transition_id)
if
valid_list
:
if
valid_list
:
valid_transition_item_list
.
append
((
wf_id
,
valid_list
))
valid_transition_item_list
.
append
((
wf_id
,
valid_list
))
...
@@ -660,8 +657,8 @@ def getClassPropertyList(klass):
...
@@ -660,8 +657,8 @@ def getClassPropertyList(klass):
return
ps_list
return
ps_list
def
intializePortalTypeERP5WorkflowMethod
(
ptype_klass
,
portal_ERP5Workflow
):
def
intializePortalTypeERP5WorkflowMethod
(
ptype_klass
,
portal_ERP5Workflow
):
### this function will be used in /product/ERP5Type/dynamic/lazy_class.py
### this function will be used in /product/ERP5Type/dynamic/lazy_class.py
### in generatePortalTypeAccessors()
### in generatePortalTypeAccessors()
wf5_module
=
aq_inner
(
portal_ERP5Workflow
)
wf5_module
=
aq_inner
(
portal_ERP5Workflow
)
portal_type
=
portal_ERP5Workflow
.
getPortalObject
().
getDefaultModule
(
portal_type
=
"portal_types"
)
portal_type
=
portal_ERP5Workflow
.
getPortalObject
().
getDefaultModule
(
portal_type
=
"portal_types"
)
pt
=
portal_type
.
_getOb
(
ptype_klass
.
__name__
)
pt
=
portal_type
.
_getOb
(
ptype_klass
.
__name__
)
...
...
product/ERP5Workflow/Document/Workflow.py
View file @
3bcb3ef5
...
@@ -52,10 +52,6 @@ class Workflow(XMLObject):
...
@@ -52,10 +52,6 @@ class Workflow(XMLObject):
add_permission
=
Permissions
.
AddPortalContent
add_permission
=
Permissions
.
AddPortalContent
isPortalContent
=
1
isPortalContent
=
1
isRADContent
=
1
isRADContent
=
1
### register the variable given by "base category value"
#state_var = 'state'
### In DCworkflow; state/transition can be registered inside workflow
# Declarative security
# Declarative security
security
=
ClassSecurityInfo
()
security
=
ClassSecurityInfo
()
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
...
@@ -151,12 +147,10 @@ class Workflow(XMLObject):
...
@@ -151,12 +147,10 @@ class Workflow(XMLObject):
return
1
return
1
return
0
return
0
### get workflow state from base category value:
def
_getERP5WorkflowStateOf
(
self
,
ob
):
def
_getERP5WorkflowStateOf
(
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
:
sdef
=
self
.
restrictedTraverse
(
state_path
)
sdef
=
self
.
restrictedTraverse
(
state_path
)
else
:
sdef
=
None
else
:
sdef
=
None
...
...
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