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
Klaus Wölfel
erp5
Commits
a47acb52
Commit
a47acb52
authored
Dec 20, 2022
by
Klaus Wölfel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a broken case of Worklist calculation when using security_uid columns
parent
599d5fe8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
product/ERP5Type/Tool/WorkflowTool.py
product/ERP5Type/Tool/WorkflowTool.py
+5
-8
No files found.
product/ERP5Type/Tool/WorkflowTool.py
View file @
a47acb52
...
...
@@ -28,6 +28,7 @@
"""
Most of the code in this file has been taken from patches/WorkflowTool.py
"""
from
collections
import
defaultdict
from
six
import
string_types
as
basestring
from
AccessControl
import
ClassSecurityInfo
,
Unauthorized
from
Acquisition
import
aq_base
...
...
@@ -947,21 +948,17 @@ def sumCatalogResultByWorklist(grouped_worklist_dict, catalog_result):
It is better to avoid reading multiple times the catalog result from
flexibility point of view: if it must ever be changed into a cursor, this
code will keep working nicely without needing to rewind the cursor.
This code assumes that all worklists have the same set of criterion ids,
and that when a criterion id is associated with an ExclusionList it is
also true for all worklists.
"""
worklist_result_dict
=
{}
if
len
(
catalog_result
)
>
0
:
# Transtype all worklist definitions where needed
criterion_id_list
=
[]
criterion_id_list
_by_worklist_dict
=
defaultdict
(
list
)
class_dict
=
{
name
:
_sql_cast_dict
.
get
(
x
[
'type'
],
_sql_cast_fallback
)
for
name
,
x
in
six
.
iteritems
(
catalog_result
.
data_dictionary
())}
for
criterion_dict
in
six
.
itervalue
s
(
grouped_worklist_dict
):
for
worklist_id
,
criterion_dict
in
six
.
iteritem
s
(
grouped_worklist_dict
):
for
criterion_id
,
criterion_value_list
in
six
.
iteritems
(
criterion_dict
):
if
type
(
criterion_value_list
)
is
not
ExclusionList
:
criterion_id_list
.
append
(
criterion_id
)
criterion_id_list
_by_worklist_dict
[
worklist_id
]
.
append
(
criterion_id
)
expected_class
=
class_dict
[
criterion_id
]
if
type
(
criterion_value_list
[
0
])
is
not
expected_class
:
criterion_dict
[
criterion_id
]
=
frozenset
([
expected_class
(
x
)
for
x
in
criterion_value_list
])
...
...
@@ -972,7 +969,7 @@ def sumCatalogResultByWorklist(grouped_worklist_dict, catalog_result):
result_count
=
int
(
result_line
[
COUNT_COLUMN_TITLE
])
for
worklist_id
,
criterion_dict
in
six
.
iteritems
(
grouped_worklist_dict
):
is_candidate
=
True
for
criterion_id
in
criterion_id_list
:
for
criterion_id
in
criterion_id_list
_by_worklist_dict
[
worklist_id
]
:
criterion_value_set
=
criterion_dict
[
criterion_id
]
if
result_line
[
criterion_id
]
not
in
criterion_value_set
:
is_candidate
=
False
...
...
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