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
Léo-Paul Géneau
erp5
Commits
7ac21fb5
Commit
7ac21fb5
authored
Nov 25, 2019
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: fix Folder_cut to check relations of sub-objects
We now have getRelationCountForDeletion API for this.
parent
31e71335
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
15 deletions
+1
-15
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_cut.py
...ore/SkinTemplateItem/portal_skins/erp5_core/Folder_cut.py
+1
-15
No files found.
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_cut.py
View file @
7ac21fb5
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
Base_translateString
=
portal
.
Base_translateString
Base_translateString
=
portal
.
Base_translateString
def
Object_hasRelation
(
obj
):
# Check if there is some related objets.
result
=
0
for
o
in
obj
.
getIndexableChildValueList
():
for
related
in
obj
.
portal_categories
.
getRelatedValueList
(
obj
):
if
related
.
getRelativeUrl
().
startswith
(
obj
.
getRelativeUrl
()):
continue
elif
related
.
getRelativeUrl
().
startswith
(
'portal_simulation'
)
:
continue
else
:
result
=
1
break
return
result
context
.
portal_selections
.
updateSelectionCheckedUidList
(
selection_name
,
listbox_uid
,
uids
)
context
.
portal_selections
.
updateSelectionCheckedUidList
(
selection_name
,
listbox_uid
,
uids
)
uids
=
context
.
portal_selections
.
getSelectionCheckedUidsFor
(
selection_name
)
uids
=
context
.
portal_selections
.
getSelectionCheckedUidsFor
(
selection_name
)
# make sure nothing is checked after
# make sure nothing is checked after
...
@@ -28,7 +14,7 @@ if uids != []:
...
@@ -28,7 +14,7 @@ if uids != []:
object_used
=
0
object_used
=
0
object_list
=
[
x
.
getObject
()
for
x
in
context
.
portal_catalog
(
uid
=
uids
)]
object_list
=
[
x
.
getObject
()
for
x
in
context
.
portal_catalog
(
uid
=
uids
)]
object_used
=
sum
([
Object_hasRelation
(
x
)
for
x
in
object_list
])
object_used
=
sum
([
x
.
getRelationCountForDeletion
(
)
for
x
in
object_list
])
if
object_used
>
0
:
if
object_used
>
0
:
if
object_used
==
1
:
if
object_used
==
1
:
...
...
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