<?xml version="1.0"?>
<ZopeData>
  <record id="1" aka="AAAAAAAAAAE=">
    <pickle>
      <tuple>
        <tuple>
          <string>Products.PythonScripts.PythonScript</string>
          <string>PythonScript</string>
        </tuple>
        <none/>
      </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>from Products.ERP5Type.Error import Error\n
\n
# Check that for all resource (and for all variations) that the total\n
# quantity is equal to 0\n
data_dict = {}\n
for line in context.objectValues(portal_type=context.getPortalDeliveryMovementTypeList()):\n
  resource_path = line.getResource()\n
  if line.hasCellContent():\n
    for cell in line.objectValues(portal_type=context.getPortalDeliveryMovementTypeList()):\n
      if cell.getQuantity() is not None:\n
        variation_list = cell.getVariationCategoryList()\n
        variation_list.sort()\n
        variation_list = tuple(variation_list)\n
        data_dict[(resource_path,variation_list)] = cell.getQuantity() \\\n
                                      +data_dict.get((resource_path,variation_list),0.0)\n
  else:\n
    if line.getQuantity() is not None:\n
      variation_list = line.getVariationCategoryList()\n
      variation_list.sort()\n
      variation_list = tuple(variation_list)\n
      data_dict[(resource_path,variation_list)] = cell.getQuantity() \\\n
                                    +data_dict.get((resource_path,variation_list),0.0)\n
\n
result_list = []\n
for ((resource_path,variation_list),quantity) in data_dict.items():\n
  if quantity!=0.0:\n
    message = "Bad Quantities for %s, %s" % (resource_path,repr(variation_list))\n
    error = Error(summary=\'DeliveryPatch_validateContent\',severity=Error.ERROR,detail=message)\n
    result_list.append(error)\n
return result_list\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>_params</string> </key>
            <value> <string></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>0</int> </value>
                    </item>
                    <item>
                        <key> <string>co_varnames</string> </key>
                        <value>
                          <tuple>
                            <string>Products.ERP5Type.Error</string>
                            <string>Error</string>
                            <string>data_dict</string>
                            <string>_getiter_</string>
                            <string>_getattr_</string>
                            <string>context</string>
                            <string>line</string>
                            <string>resource_path</string>
                            <string>cell</string>
                            <string>None</string>
                            <string>variation_list</string>
                            <string>tuple</string>
                            <string>_write_</string>
                            <string>result_list</string>
                            <string>quantity</string>
                            <string>repr</string>
                            <string>message</string>
                            <string>error</string>
                          </tuple>
                        </value>
                    </item>
                  </dictionary>
                </state>
              </object>
            </value>
        </item>
        <item>
            <key> <string>func_defaults</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>DeliveryPatch_validateContent</string> </value>
        </item>
        <item>
            <key> <string>warnings</string> </key>
            <value>
              <tuple/>
            </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
