Commit 177f9f86 authored by Jérome Perrin's avatar Jérome Perrin

revert r20322, movement.getExplanationValue raises an AttributeError in too many cases.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20476 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7e4dcf6b
...@@ -99,9 +99,13 @@ def resourceSalePriceSortMethod(a, b):\n ...@@ -99,9 +99,13 @@ def resourceSalePriceSortMethod(a, b):\n
else:\n else:\n
return sourceSortMethod(a, b)\n return sourceSortMethod(a, b)\n
\n \n
if hasattr(context, \'getExplanationValue\'):\n try:\n
explanation = context.getExplanationValue()\n explanation = context.getExplanationValue()\n
if explanation is not None:\n except AttributeError:\n
# Sometime, movements doesn\'t have an explanation.\n
explanation = None\n
\n
if explanation is not None:\n
explanation_type = explanation.getPortalType()\n explanation_type = explanation.getPortalType()\n
# XXX FIXME: Hardcoded values\n # XXX FIXME: Hardcoded values\n
if "Purchase" in explanation_type:\n if "Purchase" in explanation_type:\n
...@@ -168,10 +172,10 @@ else:\n ...@@ -168,10 +172,10 @@ else:\n
<string>destinationSortMethod</string> <string>destinationSortMethod</string>
<string>resourcePurchasePriceSortMethod</string> <string>resourcePurchasePriceSortMethod</string>
<string>resourceSalePriceSortMethod</string> <string>resourceSalePriceSortMethod</string>
<string>hasattr</string>
<string>context</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string>
<string>explanation</string> <string>explanation</string>
<string>AttributeError</string>
<string>None</string> <string>None</string>
<string>explanation_type</string> <string>explanation_type</string>
<string>_write_</string> <string>_write_</string>
......
787 788
\ 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