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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Douglas
erp5
Commits
a2122c35
Commit
a2122c35
authored
Mar 18, 2016
by
Xiaowu Zhang
Committed by
Julien Muchembled
Mar 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Base: fix special case of Preference in isDeletable
parent
6234289c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
14 deletions
+9
-14
product/ERP5Form/Document/Preference.py
product/ERP5Form/Document/Preference.py
+0
-5
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+9
-9
No files found.
product/ERP5Form/Document/Preference.py
View file @
a2122c35
...
@@ -95,8 +95,3 @@ class Preference( Folder ):
...
@@ -95,8 +95,3 @@ class Preference( Folder ):
def
disable
(
self
,
**
kw
):
def
disable
(
self
,
**
kw
):
"""Workflow method"""
"""Workflow method"""
self
.
_clearCache
()
self
.
_clearCache
()
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'isDeletable'
)
def
isDeletable
(
self
,
check_relation
):
return
not
(
check_relation
and
self
.
getRelationCountForDeletion
())
product/ERP5Type/Base.py
View file @
a2122c35
...
@@ -2688,15 +2688,15 @@ class Base( CopyContainer,
...
@@ -2688,15 +2688,15 @@ class Base( CopyContainer,
'isDeletable'
)
'isDeletable'
)
def
isDeletable
(
self
,
check_relation
):
def
isDeletable
(
self
,
check_relation
):
"""Test if object can be delete"""
"""Test if object can be delete"""
portal
=
self
.
getPortalObject
()
container
=
self
.
getParentValue
()
if
not
portal
.
portal_workflow
.
isTransitionPossible
(
self
,
'delete'
):
portal
=
container
.
getPortalObject
()
if
not
portal
.
portal_membership
.
checkPermission
(
return
(
portal
.
portal_workflow
.
isTransitionPossible
(
self
,
'delete'
)
'Delete objects'
,
self
.
getParentValue
()):
if
container
.
portal_type
!=
'Preference'
and
return
False
any
(
wf_id
!=
'edit_workflow'
for
wf_id
in
getattr
(
aq_base
(
self
),
"workflow_history"
,
()):
for
wf_id
in
getattr
(
aq_base
(
self
),
"workflow_history"
,
()))
if
wf_id
!=
'edit_workflow'
:
else
portal
.
portal_membership
.
checkPermission
(
return
False
'Delete objects'
,
container
)
return
not
(
check_relation
and
self
.
getRelationCountForDeletion
())
)
and
not
(
check_relation
and
self
.
getRelationCountForDeletion
())
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'isDeleted'
)
'isDeleted'
)
...
...
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