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
Xiaowu Zhang
erp5
Commits
7ea769a4
Commit
7ea769a4
authored
Mar 24, 2021
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_core: Fixups in parts where we call manage_delObjects of Folder_delete
and also addition of comments
parent
22bdcd89
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
18 deletions
+34
-18
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_delete.py
.../SkinTemplateItem/portal_skins/erp5_core/Folder_delete.py
+34
-18
No files found.
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_delete.py
View file @
7ea769a4
...
...
@@ -65,25 +65,41 @@ for obj in object_list:
object_to_delete_list
.
append
(
obj
)
# Remove some objects
try
:
if
object_to_remove_list
:
if
context
.
portal_type
==
'Preference'
:
if
object_to_remove_list
:
if
context
.
getPortalType
()
!=
'Preference'
:
# Use uids so that we can delete from listboxs showing documents
# that are not sub-objects of the current document
try
:
context
.
manage_delObjects
(
uids
=
[
x
.
getUid
()
for
x
in
object_to_remove_list
],
REQUEST
=
REQUEST
,
)
except
ConflictError
:
raise
except
Exception
as
error
:
# Note, this does not rollback transaction, so in case manage_delObjects
# did delete some objects these will be deleted.
# This may be considered a feature of user point of view
# (something went wrong with some documents, but some where deleted)
return
context
.
Base_renderMessage
(
str
(
error
),
"error"
)
else
:
# Templates inside preference are not indexed, so we cannot pass
# uids= to manage_delObjects and have to use ids=
context
.
manage_delObjects
(
ids
=
[
x
.
getId
()
for
x
in
object_to_remove_list
],
REQUEST
=
REQUEST
)
for
document
in
object_to_remove_list
:
try
:
document
.
getParentValue
().
manage_delObjects
(
ids
=
[
document
.
getId
()]
)
# Clear cache to recalculate the list of possible templates in case one was deleted
portal
.
portal_caches
.
clearCacheFactory
(
'erp5_ui_medium'
)
else
:
context
.
manage_delObjects
(
uids
=
[
x
.
getUid
()
for
x
in
object_to_remove_list
],
REQUEST
=
REQUEST
)
except
ConflictError
:
except
ConflictError
:
raise
except
Exception
as
error
:
except
Exception
as
error
:
# Note, this does not rollback transaction, so in case manage_delObjects
# did delete some objects these will be deleted.
# This may be considered a feature of user point of view
# (something went wrong with some documents, but some where deleted)
return
context
.
Base_renderMessage
(
str
(
error
),
"error"
)
if
object_to_remove_list
:
try
:
# record object deletion in workflow history
portal
.
portal_workflow
.
doActionFor
(
...
...
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