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
e31a8735
Commit
e31a8735
authored
Feb 14, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SimulationTool: py3
parent
2703b9b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.SimulationTool.py
...emplateItem/portal_components/tool.erp5.SimulationTool.py
+8
-4
No files found.
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.SimulationTool.py
View file @
e31a8735
...
@@ -28,6 +28,7 @@ from __future__ import division
...
@@ -28,6 +28,7 @@ from __future__ import division
#
#
##############################################################################
##############################################################################
import
functools
from
past.builtins
import
cmp
from
past.builtins
import
cmp
from
six
import
string_types
as
basestring
from
six
import
string_types
as
basestring
from
Products.CMFCore.utils
import
getToolByName
from
Products.CMFCore.utils
import
getToolByName
...
@@ -1569,8 +1570,8 @@ class SimulationTool(BaseTool):
...
@@ -1569,8 +1570,8 @@ class SimulationTool(BaseTool):
try
:
try
:
# We must copy the path so that getObject works
# We must copy the path so that getObject works
setattr
(
result
,
'path'
,
line_a
.
path
)
setattr
(
result
,
'path'
,
line_a
.
path
)
except
ValueError
:
# XXX: ValueError ? really ?
except
(
AttributeError
,
ValueError
):
# getInventory return no object, so no path available
# getInventory return
ed
no object, so no path available
pass
pass
if
parent
is
not
None
:
if
parent
is
not
None
:
result
=
result
.
__of__
(
parent
)
result
=
result
.
__of__
(
parent
)
...
@@ -1626,7 +1627,7 @@ class SimulationTool(BaseTool):
...
@@ -1626,7 +1627,7 @@ class SimulationTool(BaseTool):
try
:
try
:
result
=
cmp
(
line_a
[
key
],
line_b
[
key
])
result
=
cmp
(
line_a
[
key
],
line_b
[
key
])
except
KeyError
:
except
KeyError
:
raise
Exception
(
'Impossible to sort result since columns sort '
raise
ValueError
(
'Impossible to sort result since columns sort '
'happens on are not available in result: %r'
%
(
key
,
))
'happens on are not available in result: %r'
%
(
key
,
))
if
result
:
if
result
:
if
not
sort_direction
.
upper
().
startswith
(
'A'
):
if
not
sort_direction
.
upper
().
startswith
(
'A'
):
...
@@ -1637,7 +1638,10 @@ class SimulationTool(BaseTool):
...
@@ -1637,7 +1638,10 @@ class SimulationTool(BaseTool):
result
*=
-
1
result
*=
-
1
break
break
return
result
return
result
sorted_inventory_list
.
sort
(
cmp_inventory_line
)
if
six
.
PY2
:
sorted_inventory_list
.
sort
(
cmp_inventory_line
)
else
:
sorted_inventory_list
.
sort
(
key
=
functools
.
cmp_to_key
(
cmp_inventory_line
))
# Brain is rebuild properly using tuple not r instance
# Brain is rebuild properly using tuple not r instance
column_list
=
first_result
.
_searchable_result_columns
()
column_list
=
first_result
.
_searchable_result_columns
()
column_name_list
=
[
x
[
'name'
]
for
x
in
column_list
]
column_name_list
=
[
x
[
'name'
]
for
x
in
column_list
]
...
...
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