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
141
Merge Requests
141
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
d9f25447
Commit
d9f25447
authored
May 14, 2014
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use sort_key_method instead of sort_method.
parent
17320c43
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
13 deletions
+9
-13
product/ERP5/Tool/RoundingTool.py
product/ERP5/Tool/RoundingTool.py
+9
-13
No files found.
product/ERP5/Tool/RoundingTool.py
View file @
d9f25447
...
...
@@ -73,19 +73,15 @@ class RoundingTool(BaseTool):
parent_uid_list
.
append
(
current_document
.
getUid
())
current_document
=
current_document
.
aq_parent
def
sortMethod
(
document_a
,
document_b
):
def
score
(
document
):
context_path
=
context
.
getPhysicalPath
()
result
=
len
(
context_path
)
for
a
,
b
in
zip
(
context_path
,
document
.
getPhysicalPath
()):
if
a
==
b
:
result
-=
1
else
:
def
sortKeyMethod
(
document
):
result
=
0
for
a
,
b
in
zip
(
context_path
,
document
.
getPhysicalPath
()):
if
a
!=
b
:
break
result
-=
1
return
result
return
cmp
(
score
(
document_a
),
score
(
document_b
))
kw
[
'sort_method'
]
=
sortMethod
kw
[
'sort_key_method'
]
=
sortKeyMethod
result
=
portal
.
portal_domains
.
searchPredicateList
(
context
=
document
,
...
...
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