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
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hamza
erp5
Commits
4dc71ff7
Commit
4dc71ff7
authored
May 23, 2011
by
Yusei Tahara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sort category list. XMLMatrix.keyToId will not fail.
parent
516ab724
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
product/ERP5Type/tests/utils.py
product/ERP5Type/tests/utils.py
+13
-0
No files found.
product/ERP5Type/tests/utils.py
View file @
4dc71ff7
...
...
@@ -532,6 +532,18 @@ def updateCellList(portal, line, cell_type, cell_range_method, cell_dict_list):
else
:
return
range_list
def
getSortedCategoryList
(
line
,
base_id
,
category_list
):
category_dict
=
{}
for
category
in
category_list
:
category_dict
[
category
.
split
(
'/'
)[
0
]]
=
category
result
=
[]
index_list
=
line
.
index
[
base_id
].
keys
()
index_list
.
sort
()
for
index
in
index_list
:
base_category
=
line
.
index
[
base_id
][
index
].
keys
()[
0
].
split
(
'/'
)[
0
]
result
.
append
(
category_dict
[
base_category
])
return
result
for
cell_dict
in
cell_dict_list
:
base_id
=
cell_dict
[
'base_id'
]
if
callable
(
cell_range_method
):
...
...
@@ -589,6 +601,7 @@ def updateCellList(portal, line, cell_type, cell_range_method, cell_dict_list):
data_list
.
append
(([
row
,
column
[
index
]]
+
tab_list
,
getMappedValueDict
(
item
)))
for
category_list
,
mapped_value_dict
in
data_list
:
category_list
=
getSortedCategoryList
(
line
,
base_id
,
category_list
)
cell
=
line
.
newCell
(
portal_type
=
cell_type
,
base_id
=
base_id
,
*
category_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