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
francois
erp5
Commits
d2dadc7a
Commit
d2dadc7a
authored
Apr 22, 2016
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Review Base.isDeletable and SimulationMovement.isDeletable
parent
5a967a85
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
product/ERP5/Document/SimulationMovement.py
product/ERP5/Document/SimulationMovement.py
+6
-1
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+8
-2
No files found.
product/ERP5/Document/SimulationMovement.py
View file @
d2dadc7a
...
...
@@ -354,7 +354,12 @@ class SimulationMovement(PropertyRecordableMixin, Movement, ExplainableMixin):
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'isDeletable'
)
def
isDeletable
(
self
,
**
kw
):
def
isDeletable
(
self
,
check_relation
=
None
):
if
check_relation
is
not
None
:
if
not
super
(
SimulationMovement
,
self
).
isDeletable
(
False
):
return
False
if
not
check_relation
:
return
True
return
not
self
.
isFrozen
()
and
not
self
.
_isTreeDelivered
()
# Simulation Dates - acquire target dates
...
...
product/ERP5Type/Base.py
View file @
d2dadc7a
...
...
@@ -2686,8 +2686,14 @@ class Base( CopyContainer,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'isDeletable'
)
def
isDeletable
(
self
,
check_relation
=
True
):
"""Test if object can be delete"""
def
isDeletable
(
self
,
check_relation
):
"""Test if object can be deleted
The lack of default value for `check_relation` is intentional. Because
checking relation can take a lot of time, it forces the caller to choose
between performance (e.g. to control the visibility of an action) and
correctness (e.g. just before deleting objects).
"""
container
=
self
.
getParentValue
()
portal
=
container
.
getPortalObject
()
return
(
portal
.
portal_workflow
.
isTransitionPossible
(
self
,
'delete'
)
...
...
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