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 @@ ...@@ -125,9 +125,7 @@
</item> </item>
<item> <item>
<key> <string>columns</string> </key> <key> <string>columns</string> </key>
<value> <value> <string></string> </value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
...@@ -171,15 +169,11 @@ ...@@ -171,15 +169,11 @@
</item> </item>
<item> <item>
<key> <string>lines</string> </key> <key> <string>lines</string> </key>
<value> <value> <string></string> </value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>tabs</string> </key> <key> <string>tabs</string> </key>
<value> <value> <string></string> </value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
...@@ -217,7 +211,7 @@ ...@@ -217,7 +211,7 @@
</item> </item>
<item> <item>
<key> <string>as_cell_range_script_id</string> </key> <key> <string>as_cell_range_script_id</string> </key>
<value> <string></string> </value> <value> <string>TransformedResource_asCellRange</string> </value>
</item> </item>
<item> <item>
<key> <string>cell_base_id</string> </key> <key> <string>cell_base_id</string> </key>
...@@ -335,52 +329,4 @@ ...@@ -335,52 +329,4 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </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> </ZopeData>
...@@ -125,9 +125,7 @@ ...@@ -125,9 +125,7 @@
</item> </item>
<item> <item>
<key> <string>columns</string> </key> <key> <string>columns</string> </key>
<value> <value> <string></string> </value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
...@@ -171,15 +169,11 @@ ...@@ -171,15 +169,11 @@
</item> </item>
<item> <item>
<key> <string>lines</string> </key> <key> <string>lines</string> </key>
<value> <value> <string></string> </value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>tabs</string> </key> <key> <string>tabs</string> </key>
<value> <value> <string></string> </value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
...@@ -217,7 +211,7 @@ ...@@ -217,7 +211,7 @@
</item> </item>
<item> <item>
<key> <string>as_cell_range_script_id</string> </key> <key> <string>as_cell_range_script_id</string> </key>
<value> <string></string> </value> <value> <string>TransformedResource_asCellRange</string> </value>
</item> </item>
<item> <item>
<key> <string>cell_base_id</string> </key> <key> <string>cell_base_id</string> </key>
...@@ -335,52 +329,4 @@ ...@@ -335,52 +329,4 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </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> </ZopeData>
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>default</string> <string>default</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -74,6 +74,10 @@ ...@@ -74,6 +74,10 @@
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -118,7 +122,7 @@ ...@@ -118,7 +122,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <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> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -91,11 +91,6 @@ for c in ([line_base_category, column_base_category] + tab_base_category_list):\ ...@@ -91,11 +91,6 @@ for c in ([line_base_category, column_base_category] + tab_base_category_list):\
# Remove empty range\n # Remove empty range\n
cell_range = filter(lambda x: x != [], cell_range)\n cell_range = filter(lambda x: x != [], cell_range)\n
\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 return cell_range\n
...@@ -152,8 +147,6 @@ return cell_range\n ...@@ -152,8 +147,6 @@ return cell_range\n
<string>getattr</string> <string>getattr</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>map</string> <string>map</string>
<string>len</string>
<string>dimension</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
470 471
\ No newline at end of file \ 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