[Erp5-report] r14232 - in /erp5/trunk/bt5/erp5_accounting: SkinTemplateItem/portal_skins/er...

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Apr 25 23:44:26 CEST 2007


Author: jerome
Date: Wed Apr 25 23:44:25 2007
New Revision: 14232

URL: http://svn.erp5.org?rev=14232&view=rev
Log:
The list comprehension in InvoiceTransactionRule_asCellRange was not able to unique values when multiple predicates were using the same dimension

Modified:
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/InvoiceTransactionRule_asCellRange.xml
    erp5/trunk/bt5/erp5_accounting/bt/revision

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/InvoiceTransactionRule_asCellRange.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/InvoiceTransactionRule_asCellRange.xml?rev=14232&r1=14231&r2=14232&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/InvoiceTransactionRule_asCellRange.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/InvoiceTransactionRule_asCellRange.xml Wed Apr 25 23:44:25 2007
@@ -71,9 +71,9 @@
             <value> <string>dimension_list = [\'tax_category\', \'product\', \'region\', \'product_line\',\n
                   \'destination_region\', \'has_vat_number\', \'movement\']\n
 \n
-dimension_list.extend([ pred.getStringIndex()\n
-            for pred in context.objectValues(portal_type=\'Predicate\')\n
-            if pred.getStringIndex() not in dimension_list ])\n
+for pred in context.objectValues(portal_type=\'Predicate\'):\n
+  if pred.getStringIndex() not in dimension_list:\n
+    dimension_list.append(pred.getStringIndex())\n
 \n
 if list_dimensions:\n
   return dimension_list\n
@@ -83,8 +83,8 @@
 for dimension in dimension_list:\n
   if dimension is not None:\n
     predicate_list = [x for x in context.contentValues(portal_type=\'Predicate\')\n
-                       if x.getProperty(\'string_index\') == dimension ]\n
-    predicate_list.sort(lambda a,b: cmp(a.getProperty(\'int_index\', 0),\n
+                       if x.getStringIndex() == dimension ]\n
+    predicate_list.sort(lambda a,b: cmp(a.getProperty(\'int_index\', 1),\n
                                         b.getProperty(\'int_index\', 1)))\n
     if len(predicate_list):\n
       dimension_result_list.append(predicate_list)\n
@@ -92,7 +92,7 @@
 dimension_ids_list = []\n
 \n
 if matrixbox:\n
-  for dimension_result in dimension_result_list :\n
+  for dimension_result in dimension_result_list:\n
     dimension_ids_list.append(\n
               [(x.getObject().getRelativeUrl(),\n
                 x.getObject().getTitle()) for x in dimension_result])\n
@@ -149,15 +149,15 @@
                             <string>list_dimensions</string>
                             <string>kw</string>
                             <string>dimension_list</string>
+                            <string>_getiter_</string>
                             <string>_getattr_</string>
-                            <string>append</string>
-                            <string>$append0</string>
-                            <string>_getiter_</string>
                             <string>context</string>
                             <string>pred</string>
                             <string>dimension_result_list</string>
                             <string>dimension</string>
                             <string>None</string>
+                            <string>append</string>
+                            <string>$append0</string>
                             <string>x</string>
                             <string>predicate_list</string>
                             <string>len</string>

Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=14232&r1=14231&r2=14232&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision Wed Apr 25 23:44:25 2007
@@ -1,1 +1,1 @@
-284
+285




More information about the Erp5-report mailing list