[Erp5-report] r20502 - in /erp5/trunk/bt5/erp5_trade: SkinTemplateItem/portal_skins/erp5_tr...
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Apr 14 17:05:05 CEST 2008
Author: jerome
Date: Mon Apr 14 17:05:05 2008
New Revision: 20502
URL: http://svn.erp5.org?rev=20502&view=rev
Log:
using ERP5 Documents as dictionnary keys is wrong, because they are mutables,
so they should not define a __hash__ method.
Modified:
erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_updateTaxLineList.xml
erp5/trunk/bt5/erp5_trade/bt/revision
Modified: erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_updateTaxLineList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_updateTaxLineList.xml?rev=20502&r1=20501&r2=20502&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_updateTaxLineList.xml (original)
+++ erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_updateTaxLineList.xml Mon Apr 14 17:05:05 2008
@@ -70,8 +70,10 @@
# A mapping base_application -> total_price\n
base_application_dict = dict()\n
\n
+portal = context.getPortalObject()\n
+\n
# skip tax movement, because they will be added later\n
-valid_movement_type_list = [t for t in context.getPortalMovementTypeList()\n
+valid_movement_type_list = [t for t in portal.getPortalMovementTypeList()\n
if t != \'Tax Line\']\n
\n
def sorted(seq, comp):\n
@@ -92,9 +94,9 @@
for base_contribution in movement.getBaseContributionList():\n
# XXX non optimal loops, may needs optimisation\n
if base_contribution == base_application:\n
- applicable_movement_list[movement] = 1\n
+ applicable_movement_list[movement.getRelativeUrl()] = 1\n
\n
- for movement in applicable_movement_list:\n
+ for movement in [portal.restrictedTraverse(x) for x in applicable_movement_list.keys()]:\n
movement_price = movement.getTotalPrice(fast=0) or 0\n
if tax_line.getProperty(\'calculation_script_id\'):\n
raise NotImplementedError\n
@@ -160,11 +162,12 @@
<tuple>
<string>dict</string>
<string>base_application_dict</string>
+ <string>_getattr_</string>
+ <string>context</string>
+ <string>portal</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
- <string>_getattr_</string>
- <string>context</string>
<string>t</string>
<string>valid_movement_type_list</string>
<string>sorted</string>
@@ -177,6 +180,7 @@
<string>base_contribution_list</string>
<string>base_contribution</string>
<string>_write_</string>
+ <string>x</string>
<string>movement_price</string>
<string>NotImplementedError</string>
<string>base_amount</string>
Modified: erp5/trunk/bt5/erp5_trade/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_trade/bt/revision?rev=20502&r1=20501&r2=20502&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_trade/bt/revision (original)
+++ erp5/trunk/bt5/erp5_trade/bt/revision Mon Apr 14 17:05:05 2008
@@ -1,1 +1,1 @@
-263
+264
More information about the Erp5-report
mailing list