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
Nikola Balog
erp5
Commits
2af7cb79
Commit
2af7cb79
authored
Nov 25, 2011
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BT: let ERP5Type initialize workflow method
parent
b1fa10a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
21 deletions
+11
-21
product/ERP5/Document/BusinessTemplate.py
product/ERP5/Document/BusinessTemplate.py
+7
-21
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+4
-0
No files found.
product/ERP5/Document/BusinessTemplate.py
View file @
2af7cb79
...
...
@@ -38,7 +38,6 @@ from AccessControl.SecurityInfo import ModuleSecurityInfo
from
Products.CMFCore.utils
import
getToolByName
from
Products.PythonScripts.PythonScript
import
PythonScript
from
Products.ERP5Type.Accessor.Constant
import
PropertyGetter
as
ConstantGetter
from
Products.ERP5Type.Base
import
WorkflowMethod
from
Products.ERP5Type.Cache
import
transactional_cached
from
Products.ERP5Type.Utils
import
readLocalDocument
,
\
writeLocalDocument
,
\
...
...
@@ -4622,8 +4621,6 @@ Business Template is a set of definitions, such as skins, portal types and categ
item
.
is_bt_for_diff
=
1
item
.
build
(
self
)
build
=
WorkflowMethod
(
build
)
def
publish
(
self
,
url
,
username
=
None
,
password
=
None
):
"""
Publish in a format or another
...
...
@@ -4832,21 +4829,10 @@ Business Template is a set of definitions, such as skins, portal types and categ
site
.
portal_caches
.
clearAllCache
()
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'install'
)
def
install
(
self
,
**
kw
):
"""
For install based on paramaters provided in **kw
"""
return
self
.
_install
(
**
kw
)
install
=
WorkflowMethod
(
install
)
install
=
_install
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'reinstall'
)
def
reinstall
(
self
,
**
kw
):
"""Reinstall Business Template.
"""
return
self
.
_install
(
**
kw
)
reinstall
=
WorkflowMethod
(
reinstall
)
reinstall
=
_install
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'trash'
)
def
trash
(
self
,
new_bt
,
**
kw
):
...
...
@@ -4864,8 +4850,7 @@ Business Template is a set of definitions, such as skins, portal types and categ
self
,
getattr
(
new_bt
,
item_name
))
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'uninstall'
)
def
uninstall
(
self
,
**
kw
):
def
_uninstall
(
self
,
**
kw
):
"""
For uninstall based on paramaters provided in **kw
"""
...
...
@@ -4879,9 +4864,9 @@ Business Template is a set of definitions, such as skins, portal types and categ
# template deletes many things from the portal.
self
.
getPortalObject
().
portal_caches
.
clearAllCache
()
uninstall
=
WorkflowMethod
(
uninstall
)
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'uninstall'
)
uninstall
=
_uninstall
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'clean'
)
def
_clean
(
self
):
"""
Clean built information.
...
...
@@ -4902,7 +4887,8 @@ Business Template is a set of definitions, such as skins, portal types and categ
for
item_name
in
self
.
_item_name_list
:
setattr
(
self
,
item_name
,
None
)
clean
=
WorkflowMethod
(
_clean
)
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'clean'
)
clean
=
_clean
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getBuildingState'
)
...
...
product/ERP5Type/Base.py
View file @
2af7cb79
...
...
@@ -1493,6 +1493,10 @@ class Base( CopyContainer,
reindex_object
=
reindex_object
,
restricted
=
1
,
**
kw
)
# XXX Is this useful ? (Romain)
# Probably not. Even if it should speed up portal_type initialization and
# save some memory because edit_workflow is used in many places, I (jm)
# think it's negligible compared to the performance loss on all
# classes/types that are not bound to edit_workflow.
edit
=
WorkflowMethod
(
edit
)
# Accessing object property through ERP5ish interface
...
...
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