[Erp5-report] r36357 jerome - in /erp5/trunk/bt5/erp5_accounting: SkinTemplateItem/portal_s...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jun 15 15:01:38 CEST 2010


Author: jerome
Date: Tue Jun 15 15:01:34 2010
New Revision: 36357

URL: http://svn.erp5.org?rev=36357&view=rev
Log:
use 'isSimulated' from API, and only call this expensive method if a quantity is defined

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

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_deleteEmptyLines.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_deleteEmptyLines.xml?rev=36357&r1=36356&r2=36357&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_deleteEmptyLines.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_deleteEmptyLines.xml [utf8] Tue Jun 15 15:01:34 2010
@@ -61,20 +61,15 @@ transaction = context.getObject()\n
 transaction_lines = transaction.objectValues(portal_type=lines_portal_type)\n
 id_to_delete_list = []\n
 \n
-\n
 for line in transaction_lines:\n
-  line = line.getObject()\n
-  # Do not delete lines involved in simulation\n
-  if len(line.getDeliveryRelatedValueList(\n
-                    portal_type = \'Simulation Movement\') +\n
-          line.getOrderRelatedValueList(\n
-                    portal_type = \'Simulation Movement\')) == 0:\n
-    if not line.getSourceInventoriatedTotalAssetPrice() and \\\n
-       not line.getDestinationInventoriatedTotalAssetPrice():\n
-      id_to_delete_list.append(line.getId())\n
+  if line.getSourceInventoriatedTotalAssetPrice() or \\\n
+     line.getDestinationInventoriatedTotalAssetPrice() or \\\n
+     line.isSimulated():\n
+    continue\n
+  id_to_delete_list.append(line.getId())\n
 \n
+# Don\'t delete everything\n
 if len(id_to_delete_list) != len(transaction_lines):\n
-  # Don\'t delete everything\n
   transaction.deleteContent(id_to_delete_list)\n
 \n
 if redirect:\n

Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=36357&r1=36356&r2=36357&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision [utf8] Tue Jun 15 15:01:34 2010
@@ -1 +1 @@
-1287
\ No newline at end of file
+1288
\ No newline at end of file




More information about the Erp5-report mailing list