<?xml version="1.0"?>
<ZopeData>
  <record id="1" aka="AAAAAAAAAAE=">
    <pickle>
      <tuple>
        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
        <tuple/>
      </tuple>
    </pickle>
    <pickle>
      <dictionary>
        <item>
            <key> <string>Python_magic</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>Script_magic</string> </key>
            <value> <int>3</int> </value>
        </item>
        <item>
            <key> <string>__ac_local_roles__</string> </key>
            <value>
              <none/>
            </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 encoding="cdata"><![CDATA[

# look in the catalog to all inventory movement sort on date\n
count = 1\n
\n
portal = context.getPortalObject()\n
\n
# We have to reindex all inventory in the order of the date\n
for o in [ x.getObject() for x in portal.portal_catalog(\n
                                     portal_type = portal.getPortalInventoryMovementTypeList()\n
                                   , limit       = None\n
                                   , sort_on     = [(\'movement.start_date\',\'ascending\')]\n
                                   , sql_catalog_id = sql_catalog_id\n
                                   )\n
]:\n
  activate_kw = {\n
    \'tag\': \'inventory_%i\' % (count+1),\n
    \'after_tag\': \'inventory_%i\' % count,\n
    \'passive_commit\': passive_commit,\n
  }\n
  o.reindexObject(activate_kw=activate_kw, sql_catalog_id=sql_catalog_id)\n
  count += 1\n
\n
if final_activity_tag is not None and count > 1:\n
  # Dummy activity used to determine if the previously started activities are over.\n
  context.activate(tag=final_activity_tag\n
                  ,after_tag=\'inventory_%i\' % (count - 1, )).getId()\n


]]></string> </value>
        </item>
        <item>
            <key> <string>_code</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>_filepath</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>_owner</string> </key>
            <value>
              <none/>
            </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>errors</string> </key>
            <value>
              <tuple/>
            </value>
        </item>
        <item>
            <key> <string>func_code</string> </key>
            <value>
              <object>
                <klass>
                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
                </klass>
                <tuple/>
                <state>
                  <dictionary>
                    <item>
                        <key> <string>co_argcount</string> </key>
                        <value> <int>3</int> </value>
                    </item>
                    <item>
                        <key> <string>co_varnames</string> </key>
                        <value>
                          <tuple>
                            <string>sql_catalog_id</string>
                            <string>passive_commit</string>
                            <string>final_activity_tag</string>
                            <string>kw</string>
                            <string>count</string>
                            <string>_getattr_</string>
                            <string>context</string>
                            <string>portal</string>
                            <string>_getiter_</string>
                            <string>append</string>
                            <string>$append0</string>
                            <string>None</string>
                            <string>x</string>
                            <string>o</string>
                            <string>activate_kw</string>
                            <string>_inplacevar_</string>
                          </tuple>
                        </value>
                    </item>
                  </dictionary>
                </state>
              </object>
            </value>
        </item>
        <item>
            <key> <string>func_defaults</string> </key>
            <value>
              <tuple>
                <none/>
                <int>1</int>
                <none/>
              </tuple>
            </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>InventoryModule_reindexMovementList</string> </value>
        </item>
        <item>
            <key> <string>warnings</string> </key>
            <value>
              <tuple/>
            </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
