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
Sebastien Robin
erp5
Commits
0dd3840f
Commit
0dd3840f
authored
Dec 30, 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
f2a06123
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
product/ERP5Type/patches/WorkflowTool.py
product/ERP5Type/patches/WorkflowTool.py
+5
-8
No files found.
product/ERP5Type/patches/WorkflowTool.py
View file @
0dd3840f
...
...
@@ -39,6 +39,7 @@ from Acquisition import aq_base
from
Products.ERP5Type.Globals
import
PersistentMapping
from
MySQLdb
import
ProgrammingError
,
OperationalError
from
DateTime
import
DateTime
from
collections
import
defaultdict
security
=
ClassSecurityInfo
()
WorkflowTool
.
security
=
security
...
...
@@ -376,21 +377,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
catalog_result
.
data_dictionary
().
iteritems
()}
for
criterion_dict
in
grouped_worklist_dict
.
itervalue
s
():
for
worklist_id
,
criterion_dict
in
grouped_worklist_dict
.
iteritem
s
():
for
criterion_id
,
criterion_value_list
in
criterion_dict
.
iteritems
():
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
]
=
ImmutableSet
([
expected_class
(
x
)
for
x
in
criterion_value_list
])
...
...
@@ -401,7 +398,7 @@ def sumCatalogResultByWorklist(grouped_worklist_dict, catalog_result):
result_count
=
int
(
result_line
[
COUNT_COLUMN_TITLE
])
for
worklist_id
,
criterion_dict
in
grouped_worklist_dict
.
iteritems
():
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