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
Noah Brackenbury
erp5
Commits
8ed6f61e
Commit
8ed6f61e
authored
Jun 23, 2011
by
Yusei Tahara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update updateCellList. Support simpler data structure to add cells.
parent
8cf0df19
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
28 deletions
+39
-28
product/ERP5Type/tests/utils.py
product/ERP5Type/tests/utils.py
+39
-28
No files found.
product/ERP5Type/tests/utils.py
View file @
8ed6f61e
...
...
@@ -475,6 +475,7 @@ def updateCellList(portal, line, cell_type, cell_range_method, cell_dict_list):
- cell_range_kw
- mapped_value_argument_list
- table
- variation_category_list_and_mapped_value_list (optional)
Example:
updateCellList(sale_order_line_1_1,
...
...
@@ -523,6 +524,12 @@ def updateCellList(portal, line, cell_type, cell_range_method, cell_dict_list):
)
)
Also you can pass variation_category_list_and_mapped_value_list. Then you do not
have touse above table structure. variation_category_list_and_mapped_value_list
structure should be like following:
((variation_category_list, mapped_value),
(variation_category_list, mapped_value),
(variation_category_list, mapped_value),)
"""
def
get_range_id_list
(
range_list
):
if
not
range_list
:
...
...
@@ -569,6 +576,11 @@ def updateCellList(portal, line, cell_type, cell_range_method, cell_dict_list):
result
[
argument_name
]
=
item
[
index
]
return
result
data_list
=
[]
if
cell_dict
.
get
(
'variation_category_list_and_mapped_value_list'
):
for
variation_category_list
,
mapped_value
in
cell_dict
.
get
(
'variation_category_list_and_mapped_value_list'
):
data_list
.
append
((
variation_category_list
,
getMappedValueDict
(
mapped_value
)))
else
:
# verify table structure to know dimension.
table
=
cell_dict
[
'table'
]
if
len
([
True
for
item
in
table
if
len
(
item
)
!=
2
])
==
0
:
...
...
@@ -580,7 +592,6 @@ def updateCellList(portal, line, cell_type, cell_range_method, cell_dict_list):
else
:
raise
RuntimeError
,
"Unsupported table structure!"
data_list
=
[]
if
dimension
==
1
:
for
table_line
in
table
:
data_list
.
append
(([
table_line
[
0
]],
getMappedValueDict
(
table_line
[
1
])))
...
...
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