Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush Tiwari
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):
...
@@ -73,19 +73,15 @@ class RoundingTool(BaseTool):
parent_uid_list
.
append
(
current_document
.
getUid
())
parent_uid_list
.
append
(
current_document
.
getUid
())
current_document
=
current_document
.
aq_parent
current_document
=
current_document
.
aq_parent
def
sortMethod
(
document_a
,
document_b
):
def
score
(
document
):
context_path
=
context
.
getPhysicalPath
()
context_path
=
context
.
getPhysicalPath
()
result
=
len
(
context_path
)
def
sortKeyMethod
(
document
):
for
a
,
b
in
zip
(
context_path
,
result
=
0
document
.
getPhysicalPath
()):
for
a
,
b
in
zip
(
context_path
,
document
.
getPhysicalPath
()):
if
a
==
b
:
if
a
!=
b
:
result
-=
1
else
:
break
break
result
-=
1
return
result
return
result
return
cmp
(
score
(
document_a
),
score
(
document_b
))
kw
[
'sort_key_method'
]
=
sortKeyMethod
kw
[
'sort_method'
]
=
sortMethod
result
=
portal
.
portal_domains
.
searchPredicateList
(
result
=
portal
.
portal_domains
.
searchPredicateList
(
context
=
document
,
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