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

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Jan 21 14:32:41 CET 2010


Author: jerome
Date: Thu Jan 21 14:32:40 2010
New Revision: 31875

URL: http://svn.erp5.org?rev=31875&view=rev
Log:
Also pass activate_kw when creating lines.
Honestly, the reason is mainly because each line created will call self.getParentValue().recursiveReindexObject() which becomes incredibly slow when the balance transaction have more than REINDEX_SPLIT_COUNT sub objects.

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

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_createBalanceTransaction.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_createBalanceTransaction.xml?rev=31875&r1=31874&r2=31875&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_createBalanceTransaction.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingPeriod_createBalanceTransaction.xml [utf8] Thu Jan 21 14:32:40 2010
@@ -71,6 +71,7 @@
   return round(value, qty_precision)\n
 \n
 activity_tag = \'BalanceTransactionCreation\'\n
+activate_kw=dict(tag=activity_tag)\n
 \n
 at_date = context.getStopDate()\n
 assert at_date\n
@@ -88,7 +89,7 @@
   section = portal.portal_catalog.getObject(uid=section_uid)\n
 \n
   balance_transaction = portal.accounting_module.newContent(\n
-                          activate_kw=dict(tag=activity_tag),\n
+                          activate_kw=activate_kw,\n
                           portal_type=\'Balance Transaction\',\n
                           start_date=(at_date + 1).earliestTime(),\n
                           title=context.getTitle() or Base_translateString(\'Balance Transaction\'),\n
@@ -152,6 +153,7 @@
       balance_transaction.newContent(\n
           id=\'%03d\' % line_count,\n
           portal_type=\'Balance Transaction Line\',\n
+          activate_kw=activate_kw,\n
           destination=inventory.node_relative_url,\n
           resource=inventory.resource_relative_url,\n
           quantity=quantity,\n
@@ -168,6 +170,7 @@
         balance_transaction.newContent(\n
           id=\'%03d\' % line_count,\n
           portal_type=\'Balance Transaction Line\',\n
+          activate_kw=activate_kw,\n
           destination=inventory.node_relative_url,\n
           quantity=total_price)\n
 \n
@@ -192,6 +195,7 @@
       balance_transaction.newContent(\n
         id=\'%03d\' % line_count,\n
         portal_type=\'Balance Transaction Line\',\n
+        activate_kw=activate_kw,\n
         destination=inventory.node_relative_url,\n
         source_section_uid=inventory.mirror_section_uid,\n
         resource=inventory.resource_relative_url,\n
@@ -204,6 +208,7 @@
       balance_transaction.newContent(\n
         id=\'%03d\' % line_count,\n
         portal_type=\'Balance Transaction Line\',\n
+        activate_kw=activate_kw,\n
         destination=inventory.node_relative_url,\n
         source_section_uid=inventory.mirror_section_uid,\n
         quantity=total_price)\n
@@ -230,6 +235,7 @@
       balance_transaction.newContent(\n
         id=\'%03d\' % line_count,\n
         portal_type=\'Balance Transaction Line\',\n
+        activate_kw=activate_kw,\n
         destination=inventory.node_relative_url,\n
         resource=inventory.resource_relative_url,\n
         quantity=quantity,\n
@@ -242,6 +248,7 @@
       balance_transaction.newContent(\n
         id=\'%03d\' % line_count,\n
         portal_type=\'Balance Transaction Line\',\n
+        activate_kw=activate_kw,\n
         destination=inventory.node_relative_url,\n
         destination_payment_uid=inventory.payment_uid,\n
         quantity=total_price)\n
@@ -249,6 +256,7 @@
   # add a final line for p&l\n
   balance_transaction.newContent(\n
             id=\'%03d\' % (line_count + 1),\n
+            activate_kw=activate_kw,\n
             portal_type=\'Balance Transaction Line\',\n
             destination=profit_and_loss_account,\n
             quantity=-profit_and_loss_quantity)\n
@@ -307,6 +315,7 @@
                             <string>precision_cache</string>
                             <string>roundCurrency</string>
                             <string>activity_tag</string>
+                            <string>activate_kw</string>
                             <string>at_date</string>
                             <string>AssertionError</string>
                             <string>section</string>

Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=31875&r1=31874&r2=31875&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision [utf8] Thu Jan 21 14:32:40 2010
@@ -1,1 +1,1 @@
-1087
+1088




More information about the Erp5-report mailing list