[Erp5-report] r24246 - in /erp5/trunk/bt5/erp5_trade: SkinTemplateItem/portal_skins/erp5_tr...
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Oct 20 11:37:06 CEST 2008
Author: jerome
Date: Mon Oct 20 11:36:22 2008
New Revision: 24246
URL: http://svn.erp5.org?rev=24246&view=rev
Log:
when updating tax lines, use a method that is compatible with temp objects
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=24246&r1=24245&r2=24246&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 Oct 20 11:36:22 2008
@@ -64,6 +64,15 @@
valid_movement_type_list = [t for t in portal.getPortalMovementTypeList()\n
if t != \'Tax Line\']\n
\n
+def getRelatedPath(parent, child):\n
+ """returns child\'s relative path in parent, as a tuple that can later be used\n
+ as an argument to parent.restrictedTraverse to find back the child.\n
+ """\n
+ parent_path_length = len(parent.getPhysicalPath())\n
+ child_path = child.getPhysicalPath()\n
+ context.log((child, child_path, child_path[parent_path_length:]))\n
+ return child_path[parent_path_length:]\n
+\n
def sorted(seq, comp):\n
seq = seq[::]\n
seq.sort(comp)\n
@@ -82,7 +91,7 @@
for base_contribution in movement.getBaseContributionList():\n
# XXX non optimal loops, may needs optimisation\n
if base_contribution == base_application:\n
- applicable_movement_list[id(movement)] = movement\n
+ applicable_movement_list[getRelatedPath(context, movement)] = movement\n
\n
for movement in applicable_movement_list.values():\n
movement_price = movement.getTotalPrice(fast=0) or 0\n
@@ -146,6 +155,7 @@
<string>_getiter_</string>
<string>t</string>
<string>valid_movement_type_list</string>
+ <string>getRelatedPath</string>
<string>sorted</string>
<string>tax_line</string>
<string>applicable_movement_list</string>
@@ -156,7 +166,6 @@
<string>base_contribution_list</string>
<string>base_contribution</string>
<string>_write_</string>
- <string>id</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=24246&r1=24245&r2=24246&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_trade/bt/revision (original)
+++ erp5/trunk/bt5/erp5_trade/bt/revision Mon Oct 20 11:36:22 2008
@@ -1,1 +1,1 @@
-515
+516
More information about the Erp5-report
mailing list