[Erp5-report] r45533 aurel - /erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skin...
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Apr 18 10:40:39 CEST 2011
Author: aurel
Date: Mon Apr 18 10:40:39 2011
New Revision: 45533
URL: http://svn.erp5.org?rev=45533&view=rev
Log:
This script should not have been removed in commit 45440
it overrides the default script as in banking, table delivery does not exists, instead date are store in table catalog, so use this table to do the sort
Added:
erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/InventoryModule_reindexMovementList.xml
Added: erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/InventoryModule_reindexMovementList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/InventoryModule_reindexMovementList.xml?rev=45533&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/InventoryModule_reindexMovementList.xml (added)
+++ erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/InventoryModule_reindexMovementList.xml [utf8] Mon Apr 18 10:40:39 2011
@@ -0,0 +1,94 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>Script_magic</string> </key>
+ <value> <int>3</int> </value>
+ </item>
+ <item>
+ <key> <string>_bind_names</string> </key>
+ <value>
+ <object>
+ <klass>
+ <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+ </klass>
+ <tuple/>
+ <state>
+ <dictionary>
+ <item>
+ <key> <string>_asgns</string> </key>
+ <value>
+ <dictionary>
+ <item>
+ <key> <string>name_container</string> </key>
+ <value> <string>container</string> </value>
+ </item>
+ <item>
+ <key> <string>name_context</string> </key>
+ <value> <string>context</string> </value>
+ </item>
+ <item>
+ <key> <string>name_m_self</string> </key>
+ <value> <string>script</string> </value>
+ </item>
+ <item>
+ <key> <string>name_subpath</string> </key>
+ <value> <string>traverse_subpath</string> </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>_body</string> </key>
+ <value> <string># Inventory requires reindexing when older movements become available, because\n
+# inventory generates deltas against the past stock, using a catalog. It is only\n
+# necessary to reindex Inventory documents instead of Inventory movements, because\n
+# Inventory reindexes its movements in a special way to the stock table by itself.\n
+#\n
+# FIXME: I think it would be better to replace this script with a good interactor\n
+# which reindexes future inventory documents.\n
+previous_tag = None\n
+portal = context.getPortalObject()\n
+\n
+# We have to reindex all inventory documents in the order of the dates.\n
+# Uids are used to make the ordering consistent, even when multiple documents have\n
+# the same date.\n
+for inventory in portal.portal_catalog(portal_type=portal.getPortalInventoryTypeList(),\n
+ limit=None,\n
+ sort_on=[(\'catalog.start_date\', \'ascending\'), (\'uid\', \'ascending\')],\n
+ sql_catalog_id=sql_catalog_id):\n
+ inventory = inventory.getObject()\n
+ tag = \'inventory_%i\' % inventory.getUid()\n
+ activate_kw = dict(tag=tag, passive_commit=passive_commit)\n
+ if previous_tag is not None:\n
+ activate_kw[\'after_tag\'] = previous_tag\n
+ previous_tag = tag\n
+ inventory.reindexObject(activate_kw=activate_kw, sql_catalog_id=sql_catalog_id)\n
+\n
+if final_activity_tag is not None and previous_tag is not None:\n
+ # Dummy activity used to determine if the previously started activities are over.\n
+ context.activate(tag=final_activity_tag, after_tag=previous_tag).getId()\n
+</string> </value>
+ </item>
+ <item>
+ <key> <string>_params</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>InventoryModule_reindexMovementList</string> </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
More information about the Erp5-report
mailing list