Commit 3f71dca5 authored by Aurel's avatar Aurel

override InventoryModule_reindexMovementList as start_date is available

only in catalog table in erp5_banking's catalog


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44555 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d244e6c7
No related merge requests found
<?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
\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>sql_catalog_id=None, passive_commit=1, final_activity_tag=None, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>InventoryModule_reindexMovementList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
558
\ No newline at end of file
559
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment