Commit ffc542b7 authored by Thierry's avatar Thierry

transformation_correspondance_print improved


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@272 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cd074317
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
##bind namespace= ##bind namespace=
##bind script=script ##bind script=script
##bind subpath=traverse_subpath ##bind subpath=traverse_subpath
##parameters= ##parameters=transformation=None, quantities=1
##title= ##title=
## ##
transformed_component = context transformed_component = context
...@@ -14,7 +14,8 @@ variation_base_category_list = [] ...@@ -14,7 +14,8 @@ variation_base_category_list = []
q_variation_base_category_list = transformed_component.getQVariationBaseCategoryList() q_variation_base_category_list = transformed_component.getQVariationBaseCategoryList()
v_variation_base_category_list = transformed_component.getVVariationBaseCategoryList() v_variation_base_category_list = transformed_component.getVVariationBaseCategoryList()
for base_category in q_variation_base_category_list : if quantities :
for base_category in q_variation_base_category_list :
variation_base_category_list.append(base_category) variation_base_category_list.append(base_category)
for base_category in v_variation_base_category_list : for base_category in v_variation_base_category_list :
...@@ -25,7 +26,7 @@ variation_base_category_list.sort() ...@@ -25,7 +26,7 @@ variation_base_category_list.sort()
variation_list_list = [] variation_list_list = []
for base_category in variation_base_category_list : for base_category in variation_base_category_list :
variation_list = context.aq_parent.getVariationCategoryList(base_category_list = base_category) variation_list = transformation.getVariationCategoryList(base_category_list = base_category)
variation_list_list.append(variation_list) variation_list_list.append(variation_list)
cartesian_variation_list = context.cartesianProduct(variation_list_list) cartesian_variation_list = context.cartesianProduct(variation_list_list)
...@@ -54,6 +55,14 @@ for variation_list in cartesian_variation_list : ...@@ -54,6 +55,14 @@ for variation_list in cartesian_variation_list :
pretty_variation_2 = '- ' pretty_variation_2 = '- '
for my_variation in variation : for my_variation in variation :
pretty_variation_2 += my_variation+' - ' pretty_variation_2 += my_variation+' - '
if pretty_variation_2 == '- ' :
try :
pretty_variation_2 += transformed_component.getVariationCategoryList()[0]
except :
pass
if quantities :
correspondance_list.append([pretty_variation_1, quantity, pretty_variation_2]) correspondance_list.append([pretty_variation_1, quantity, pretty_variation_2])
else :
correspondance_list.append([pretty_variation_1, '', pretty_variation_2])
return correspondance_list return correspondance_list
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
<tr> <tr>
<td colspan="3" > <td colspan="3" >
<table class="border" border="0" width="100%" <table class="border" border="0" width="100%"
tal:define="correspondances_list python:transformed_resource.TransformedComponent_getCorrespondanceList()"> tal:define="correspondances_list python:transformed_resource.TransformedComponent_getCorrespondanceList(transformation,quantities=0)">
<tr tal:condition="python:len(correspondances_list)==0"> <tr tal:condition="python:len(correspondances_list)==0">
<td> <td>
<span tal:repeat="variation_item python:transformed_resource.getVariationCategoryList()"> <span tal:repeat="variation_item python:transformed_resource.getVariationCategoryList()">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment