[Erp5-report] r20476 - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateItem/p...
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Apr 14 11:33:13 CEST 2008
Author: jerome
Date: Mon Apr 14 11:33:12 2008
New Revision: 20476
URL: http://svn.erp5.org?rev=20476&view=rev
Log:
revert r20322, movement.getExplanationValue raises an AttributeError in too many cases.
Modified:
erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Movement_getPriceCalculationOperandDict.xml
erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Movement_getPriceCalculationOperandDict.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Movement_getPriceCalculationOperandDict.xml?rev=20476&r1=20475&r2=20476&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Movement_getPriceCalculationOperandDict.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Movement_getPriceCalculationOperandDict.xml Mon Apr 14 11:33:12 2008
@@ -99,15 +99,19 @@
else:\n
return sourceSortMethod(a, b)\n
\n
-if hasattr(context, \'getExplanationValue\'):\n
+try:\n
explanation = context.getExplanationValue()\n
- if explanation is not None:\n
- explanation_type = explanation.getPortalType()\n
- # XXX FIXME: Hardcoded values\n
- if "Purchase" in explanation_type:\n
- kw[\'sort_method\'] = resourcePurchasePriceSortMethod\n
- elif "Sale" in explanation_type:\n
- kw[\'sort_method\'] = resourceSalePriceSortMethod\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
+ # XXX FIXME: Hardcoded values\n
+ if "Purchase" in explanation_type:\n
+ kw[\'sort_method\'] = resourcePurchasePriceSortMethod\n
+ elif "Sale" in explanation_type:\n
+ kw[\'sort_method\'] = resourceSalePriceSortMethod\n
\n
resource = context.getResourceValue()\n
if resource is not None:\n
@@ -168,10 +172,10 @@
<string>destinationSortMethod</string>
<string>resourcePurchasePriceSortMethod</string>
<string>resourceSalePriceSortMethod</string>
- <string>hasattr</string>
+ <string>_getattr_</string>
<string>context</string>
- <string>_getattr_</string>
<string>explanation</string>
+ <string>AttributeError</string>
<string>None</string>
<string>explanation_type</string>
<string>_write_</string>
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=20476&r1=20475&r2=20476&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision Mon Apr 14 11:33:12 2008
@@ -1,1 +1,1 @@
-787
+788
More information about the Erp5-report
mailing list