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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tomáš Peterka
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
Hide 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
):
context_path
=
context
.
getPhysicalPath
()
def
score
(
document
):
def
sortKeyMethod
(
document
):
context_path
=
context
.
getPhysicalPath
()
result
=
0
result
=
len
(
context_path
)
for
a
,
b
in
zip
(
context_path
,
document
.
getPhysicalPath
()):
for
a
,
b
in
zip
(
context_path
,
if
a
!=
b
:
document
.
getPhysicalPath
()):
break
if
a
==
b
:
result
-=
1
result
-=
1
return
result
else
:
kw
[
'sort_key_method'
]
=
sortKeyMethod
break
return
result
return
cmp
(
score
(
document_a
),
score
(
document_b
))
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