Commit 65414f15 authored by Nicolas Delaby's avatar Nicolas Delaby

Handle None values

Change listbox column ids

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22311 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4453da0d
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.ERP5Type.Document import newTempBase\n <value> <string>from Products.ERP5Type.Document import newTempBase\n
catalog = context.portal_catalog.getResultValue\n catalog = context.portal_catalog.getResultValue\n
if current == 1:\n if current:\n
method = context.portal_simulation.getCurrentTrackingList\n method = context.portal_simulation.getCurrentTrackingList\n
else:\n else:\n
method = context.portal_simulation.getTrackingList\n method = context.portal_simulation.getTrackingList\n
...@@ -84,16 +84,18 @@ kw[\'item.simulation_state\'] = simulation_state\n ...@@ -84,16 +84,18 @@ kw[\'item.simulation_state\'] = simulation_state\n
for res in method(aggregate_uid=uid, **kw):\n for res in method(aggregate_uid=uid, **kw):\n
history = newTempBase(context, str(len(history_list)))\n history = newTempBase(context, str(len(history_list)))\n
explanation = catalog(uid=res.delivery_uid).getExplanationValue()\n explanation = catalog(uid=res.delivery_uid).getExplanationValue()\n
\n node_value = catalog(uid=res.node_uid)\n
section_value = catalog(uid=res.section_uid)\n
resource_value = catalog(uid=res.resource_uid)\n
history.edit(\n history.edit(\n
#uid = catalog(uid=res.uid).getTitle(),\n #uid = catalog(uid=res.uid).getTitle(),\n
date=res.date,\n date=res.date,\n
node_uid=catalog(uid=res.node_uid).getTitle(),\n node_title=node_value is not None and node_value.getTitle() or None,\n
section_uid=catalog(uid=res.section_uid).getTitle(),\n section_title=section_value is not None and section_value.getTitle() or None,\n
resource_uid=catalog(uid=res.resource_uid).getTitle(),\n resource_title=resource_value is not None and resource_value.getTitle() or None,\n
explanation=explanation.getTitle(),\n explanation=explanation.getTitle(),\n
url=explanation.absolute_url(),\n url=explanation.absolute_url(),\n
simulation_state = explanation.getTranslatedSimulationState(),\n simulation_state=explanation.getTranslatedSimulationState(),\n
)\n )\n
history_list.append(history)\n history_list.append(history)\n
\n \n
...@@ -120,7 +122,7 @@ return history_list\n ...@@ -120,7 +122,7 @@ return history_list\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>current=1,*args, **kw</string> </value> <value> <string>current=1, *args, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -166,6 +168,10 @@ return history_list\n ...@@ -166,6 +168,10 @@ return history_list\n
<string>len</string> <string>len</string>
<string>history</string> <string>history</string>
<string>explanation</string> <string>explanation</string>
<string>node_value</string>
<string>section_value</string>
<string>resource_value</string>
<string>None</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -94,15 +94,15 @@ ...@@ -94,15 +94,15 @@
<string>Date</string> <string>Date</string>
</tuple> </tuple>
<tuple> <tuple>
<string>node_uid</string> <string>node_title</string>
<string>Node</string> <string>Node</string>
</tuple> </tuple>
<tuple> <tuple>
<string>section_uid</string> <string>section_title</string>
<string>Section</string> <string>Section</string>
</tuple> </tuple>
<tuple> <tuple>
<string>resource_uid</string> <string>resource_title</string>
<string>Resource</string> <string>Resource</string>
</tuple> </tuple>
<tuple> <tuple>
......
49 50
\ 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