Commit 373a9498 authored by Nicolas Dumazet's avatar Nicolas Dumazet

revert r33738, and fix the issue correctly.

* Replace deprecated "columns", "lines" & "tabs" properties of matrixbox by the
  shiny, better "as_cell_range_script_id"
* check that cell is not None when rendering matrixbox_quantity


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33750 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 93fd21de
......@@ -125,9 +125,7 @@
</item>
<item>
<key> <string>columns</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
......@@ -171,15 +169,11 @@
</item>
<item>
<key> <string>lines</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>tabs</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -217,7 +211,7 @@
</item>
<item>
<key> <string>as_cell_range_script_id</string> </key>
<value> <string></string> </value>
<value> <string>TransformedResource_asCellRange</string> </value>
</item>
<item>
<key> <string>cell_base_id</string> </key>
......@@ -335,52 +329,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.TransformedResource_asCellRange(base_id=\'quantity\',matrixbox=1)[1]</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.TransformedResource_asCellRange(base_id=\'quantity\',matrixbox=1)[0]</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.TransformedResource_asCellRange(base_id=\'quantity\',matrixbox=1)[2]</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -125,9 +125,7 @@
</item>
<item>
<key> <string>columns</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
......@@ -171,15 +169,11 @@
</item>
<item>
<key> <string>lines</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>tabs</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -217,7 +211,7 @@
</item>
<item>
<key> <string>as_cell_range_script_id</string> </key>
<value> <string></string> </value>
<value> <string>TransformedResource_asCellRange</string> </value>
</item>
<item>
<key> <string>cell_base_id</string> </key>
......@@ -335,52 +329,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.TransformedResource_asCellRange(base_id=\'variation\',matrixbox=1)[1]</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.TransformedResource_asCellRange(base_id=\'variation\',matrixbox=1)[0]</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.TransformedResource_asCellRange(base_id=\'variation\',matrixbox=1)[2]</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -13,8 +13,8 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
<string>default</string>
<string>title</string>
</list>
</value>
</item>
......@@ -74,6 +74,10 @@
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -118,7 +122,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: cell.getProperty(\'quantity\')</string> </value>
<value> <string>python: cell is not None and cell.getProperty(\'quantity\')</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -91,11 +91,6 @@ for c in ([line_base_category, column_base_category] + tab_base_category_list):\
# Remove empty range\n
cell_range = filter(lambda x: x != [], cell_range)\n
\n
dimension = len(cell_range)\n
if matrixbox and dimension<3:\n
# Matrixbox view always expects three dimensions (lines, columns, tabs)\n
# It costs very little to avoid noisy rendering tracebacks\n
return cell_range + [[]]*(3-dimension)\n
return cell_range\n
......@@ -152,8 +147,6 @@ return cell_range\n
<string>getattr</string>
<string>_getitem_</string>
<string>map</string>
<string>len</string>
<string>dimension</string>
</tuple>
</value>
</item>
......
470
\ No newline at end of file
471
\ No newline at end of file
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