Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush Tiwari
erp5
Commits
c46086d2
Commit
c46086d2
authored
Nov 22, 2017
by
Ayush Tiwari
Committed by
Ayush Tiwari
Dec 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add type_workflow property to ERP5type
parent
fe0112f8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
0 deletions
+72
-0
product/ERP5Type/ERP5Type.py
product/ERP5Type/ERP5Type.py
+72
-0
No files found.
product/ERP5Type/ERP5Type.py
View file @
c46086d2
...
@@ -225,6 +225,12 @@ class ERP5TypeInformation(XMLObject,
...
@@ -225,6 +225,12 @@ class ERP5TypeInformation(XMLObject,
# Declarative properties
# Declarative properties
property_sheets
=
(
PropertySheet
.
BaseType
,
)
property_sheets
=
(
PropertySheet
.
BaseType
,
)
_properties
=
(
{
'id'
:
'type_workflow'
,
'type'
:
'multiple selection'
,
'mode'
:
'w'
},
)
acquire_local_roles
=
False
acquire_local_roles
=
False
property_sheet_list
=
()
property_sheet_list
=
()
base_category_list
=
()
base_category_list
=
()
...
@@ -328,6 +334,72 @@ class ERP5TypeInformation(XMLObject,
...
@@ -328,6 +334,72 @@ class ERP5TypeInformation(XMLObject,
# Acquisition editing interface
# Acquisition editing interface
#
#
def
getTypeFilterContentType
(
self
):
return
def
getTypeInitScriptId
(
self
):
return
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'getTypeWorkflowList'
)
def
getTypeWorkflowList
(
self
):
"""Getter for 'type_workflow_list' property"""
pw
=
self
.
getPortalObject
().
portal_workflow
cbt
=
pw
.
_chains_by_type
id
=
self
.
getId
()
if
cbt
is
not
None
and
cbt
.
has_key
(
id
):
workflow_list
=
list
(
cbt
[
id
])
else
:
workflow_list
=
None
return
workflow_list
def
hasTypeWorkflowList
(
self
):
"""
Always return True. Overriden as general accessor is generated after the
use of this function while installing Business Manager
"""
return
True
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'setTypeWorkflowList'
)
def
_setTypeWorkflowList
(
self
,
type_workflow_list
):
"""Override Setter for 'type_workflow' property"""
# We use setter to update the value for Workflow chain during the
# installation of Business Manager. This way, we would be able to
# modify workflow chain without the need of saving anything in
# type_workflow_list property.
portal
=
self
.
getPortalObject
()
pw
=
portal
.
portal_workflow
cbt
=
pw
.
_chains_by_type
# Create empty chains dict if it is empty
if
cbt
is
None
:
cbt
=
{}
id
=
self
.
getId
()
# If the type_workflow_list is empty, delete the key from workflow chains
if
not
type_workflow_list
:
cbt
[
id
]
=
[]
pw
.
_chains_by_type
=
cbt
# If type_workflow_list is '(Default)', don't do/update anything
elif
type_workflow_list
[
0
]
!=
'(Default)'
:
# If there is already key existing in cbt, then update it
if
cbt
is
not
None
and
cbt
.
has_key
(
id
):
workflow_list
=
list
(
cbt
[
id
])
if
not
workflow_list
:
cbt
[
id
]
=
sorted
(
type_workflow_list
)
# If the value in cbt is '(Default)', then update it only after removing
# default value
elif
workflow_list
[
0
]
!=
'(Default)'
:
type_workflow_list
=
type_workflow_list
.
extend
(
workflow_list
)
cbt
[
id
]
=
sorted
(
type_workflow_list
)
# Update the chains dictionary for portal_workflow
pw
.
_chains_by_type
=
cbt
security
.
declarePrivate
(
'_guessMethodAliases'
)
security
.
declarePrivate
(
'_guessMethodAliases'
)
def
_guessMethodAliases
(
self
):
def
_guessMethodAliases
(
self
):
""" Override this method to disable Method Aliases in ERP5.
""" Override this method to disable Method Aliases in ERP5.
...
...
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