Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_rtl_support
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
Romain Courteaud
erp5_rtl_support
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
Show 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 ):
def
disable
(
self
,
**
kw
):
"""Workflow method"""
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,
'isDeletable'
)
def
isDeletable
(
self
,
check_relation
):
"""Test if object can be delete"""
portal
=
self
.
getPortalObject
()
if
not
portal
.
portal_workflow
.
isTransitionPossible
(
self
,
'delete'
):
if
not
portal
.
portal_membership
.
checkPermission
(
'Delete objects'
,
self
.
getParentValue
()):
return
False
for
wf_id
in
getattr
(
aq_base
(
self
),
"workflow_history"
,
()):
if
wf_id
!=
'edit_workflow'
:
return
False
return
not
(
check_relation
and
self
.
getRelationCountForDeletion
())
container
=
self
.
getParentValue
()
portal
=
container
.
getPortalObject
()
return
(
portal
.
portal_workflow
.
isTransitionPossible
(
self
,
'delete'
)
if
container
.
portal_type
!=
'Preference'
and
any
(
wf_id
!=
'edit_workflow'
for
wf_id
in
getattr
(
aq_base
(
self
),
"workflow_history"
,
()))
else
portal
.
portal_membership
.
checkPermission
(
'Delete objects'
,
container
)
)
and
not
(
check_relation
and
self
.
getRelationCountForDeletion
())
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'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