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
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
0ea92221
Commit
0ea92221
authored
Mar 04, 2021
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_xhtml_style: remove not needed cache
This case breaks action calculation between xhtml style and ERP5JS.
parent
c649ed0d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
25 deletions
+1
-25
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_filterDuplicateActions.py
...tal_skins/erp5_xhtml_style/Base_filterDuplicateActions.py
+1
-25
No files found.
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_filterDuplicateActions.py
View file @
0ea92221
...
@@ -5,7 +5,6 @@ In case of duplicate, only the first action will be kept.
...
@@ -5,7 +5,6 @@ In case of duplicate, only the first action will be kept.
`actions` is the mapping returned by ActionsTool.listFilteredActionsFor
`actions` is the mapping returned by ActionsTool.listFilteredActionsFor
The script must be called on the context of the document.
The script must be called on the context of the document.
"""
"""
from
Products.ERP5Type.Cache
import
CachingMethod
def
filterDuplicateActions
(
actions
):
def
filterDuplicateActions
(
actions
):
new_actions
=
{}
new_actions
=
{}
...
@@ -26,29 +25,6 @@ def filterDuplicateActions(actions):
...
@@ -26,29 +25,6 @@ def filterDuplicateActions(actions):
return
new_actions
return
new_actions
def
hasDuplicateActions
(
portal_type
,
user_name
):
# Compare the count of action categories and actions
# Give every category a amount of 1000, as
# 'object_onlyxhtml_view' is transformed into 'object_view'
len_actions
=
0
len_filtered_actions
=
0
for
cat
in
actions
.
values
():
len_actions
+=
1000
+
len
(
cat
)
filtered_actions
=
filterDuplicateActions
(
actions
)
for
cat
in
filtered_actions
.
values
():
len_filtered_actions
+=
1000
+
len
(
cat
)
return
len_actions
!=
len_filtered_actions
hasDuplicateActions
=
CachingMethod
(
hasDuplicateActions
,
id
=
'Base_filterDuplicateActions.hasDuplicateActions'
,
cache_factory
=
'erp5_ui_long'
)
user_name
=
getattr
(
container
.
REQUEST
,
'AUTHENTICATED_USER'
,
''
)
if
getattr
(
context
,
'getPortalType'
,
None
)
is
not
None
:
if
getattr
(
context
,
'getPortalType'
,
None
)
is
not
None
:
if
hasDuplicateActions
(
context
.
getPortalType
(),
user_name
):
return
filterDuplicateActions
(
actions
)
return
filterDuplicateActions
(
actions
)
return
actions
return
actions
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