Commit f5830ba3 authored by Julien Muchembled's avatar Julien Muchembled

Fix generation of ODT reports:

* Do not store objects in selections.
* ReportSection requires listboxes to be named 'listbox'

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25544 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6f3c3119
...@@ -61,12 +61,9 @@ ...@@ -61,12 +61,9 @@
def compareId(a, b):\n def compareId(a, b):\n
return cmp(normalise(a.id), normalise(b.id))\n return cmp(normalise(a.id), normalise(b.id))\n
\n \n
class_method_list = kw["class_method_list"]\n
obj = kw["obj"]\n
\n
result = map(\n result = map(\n
lambda x: obj.asContext(id=x),\n lambda x: context.asContext(id=x),\n
class_method_list \n class_method_list\n
)\n )\n
result.sort(compareId)\n result.sort(compareId)\n
return result\n return result\n
...@@ -80,7 +77,7 @@ return result\n ...@@ -80,7 +77,7 @@ return result\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>**kw</string> </value> <value> <string>class_method_list, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -100,18 +97,16 @@ return result\n ...@@ -100,18 +97,16 @@ return result\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>class_method_list</string>
<string>kw</string> <string>kw</string>
<string>normalise</string> <string>normalise</string>
<string>compareId</string> <string>compareId</string>
<string>_getitem_</string>
<string>class_method_list</string>
<string>obj</string>
<string>map</string> <string>map</string>
<string>result</string> <string>result</string>
<string>_getattr_</string> <string>_getattr_</string>
......
...@@ -61,13 +61,9 @@ ...@@ -61,13 +61,9 @@
def compareId(a, b):\n def compareId(a, b):\n
return cmp(normalise(a.id), normalise(b.id))\n return cmp(normalise(a.id), normalise(b.id))\n
\n \n
property_sheet_list = kw["property_sheet_list"]\n
\n
obj = kw["obj"]\n
\n
result = map(\n result = map(\n
lambda x: obj.asContext(id=x),\n lambda x: context.asContext(id=x),\n
property_sheet_list \n property_sheet_list\n
)\n )\n
result.sort(compareId)\n result.sort(compareId)\n
return result\n return result\n
...@@ -81,7 +77,7 @@ return result\n ...@@ -81,7 +77,7 @@ return result\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>**kw</string> </value> <value> <string>property_sheet_list, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -101,18 +97,16 @@ return result\n ...@@ -101,18 +97,16 @@ return result\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>property_sheet_list</string>
<string>kw</string> <string>kw</string>
<string>normalise</string> <string>normalise</string>
<string>compareId</string> <string>compareId</string>
<string>_getitem_</string>
<string>property_sheet_list</string>
<string>obj</string>
<string>map</string> <string>map</string>
<string>result</string> <string>result</string>
<string>_getattr_</string> <string>_getattr_</string>
......
...@@ -259,9 +259,11 @@ if portal_skin is not None and portal_skin=="ODT":\n ...@@ -259,9 +259,11 @@ if portal_skin is not None and portal_skin=="ODT":\n
)\n )\n
result.append(\n result.append(\n
ReportSection(\n ReportSection(\n
path=context.getPortalObject().portal_classes.getRelativeUrl(),\n
method_id=\'getDocumentationHelper\',\n
param_list=(section.getClassName(), uri),\n
form_id=\'PortalTypeDocumentationHelperAppendixClassMethod_view\',\n form_id=\'PortalTypeDocumentationHelperAppendixClassMethod_view\',\n
selection_params=dict(class_method_list=classmethod, obj=uri_object),\n selection_params=dict(class_method_list=classmethod),\n
selection_name=\'class_method_selection\',\n
listbox_display_mode=\'FlatListMode\')\n listbox_display_mode=\'FlatListMode\')\n
)\n )\n
if propertysheet.keys() != []:\n if propertysheet.keys() != []:\n
...@@ -283,9 +285,11 @@ if portal_skin is not None and portal_skin=="ODT":\n ...@@ -283,9 +285,11 @@ if portal_skin is not None and portal_skin=="ODT":\n
)\n )\n
result.append(\n result.append(\n
ReportSection(\n ReportSection(\n
path=context.getPortalObject().portal_classes.getRelativeUrl(),\n
method_id=\'getDocumentationHelper\',\n
param_list=(section.getClassName(), uri),\n
form_id=\'PortalTypeDocumentationHelperAppendixPropertySheet_view\',\n form_id=\'PortalTypeDocumentationHelperAppendixPropertySheet_view\',\n
selection_params=dict(property_sheet_list=propertysheet.keys(), obj=uri_object),\n selection_params=dict(property_sheet_list=propertysheet.keys()),\n
selection_name=\'property_sheet_selection\',\n
listbox_display_mode=\'FlatListMode\')\n listbox_display_mode=\'FlatListMode\')\n
)\n )\n
class_name = \'PortalTypePropertySheetDocumentationHelper\'\n class_name = \'PortalTypePropertySheetDocumentationHelper\'\n
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<key> <string>bottom</string> </key> <key> <string>bottom</string> </key>
<value> <value>
<list> <list>
<string>class_method_listbox</string> <string>listbox</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>class_method_listbox</string> </value> <value> <string>listbox</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<key> <string>bottom</string> </key> <key> <string>bottom</string> </key>
<value> <value>
<list> <list>
<string>property_sheet_listbox</string> <string>listbox</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>property_sheet_listbox</string> </value> <value> <string>listbox</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
163 165
\ 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