<?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 encoding="cdata"><![CDATA[

portal_property_sheets = context.getPortalObject().portal_property_sheets\n
\n
id_list = portal_property_sheets.objectIds()\n
\n
unwanted_id_list = [\n
    \'FreeFiberRequest\', \'VifibAssignmentConstraint\',\n
    \'VifibCapacity\', \'VifibComputerConstraint\',\n
    \'VifibComputerPartitionConstraint\',\n
    \'VifibEmailConstraint\', \'VifibHostingSubscriptionConstraint\',\n
    \'VifibInternalPackingListConstraint\', \'VifibInternalPackingListLineConstraint\',\n
    \'VifibOpenSaleOrderConstraint\', \'VifibOpenSaleOrderLineConstraint\',\n
    \'VifibPersonConstraint\', \'VifibPurchasePackingListConstraint\',\n
    \'VifibPurchasePackingListLineConstraint\',\n
    \'VifibRestAPISystemPreference\', \'VifibSaleInvoiceConstraint\',\n
    \'VifibSaleOrderConstraint\', \'VifibSaleOrderLineConstraint\',\n
    \'VifibSalePackingListConstraint\', \'VifibSalePackingListLineConstraint\',\n
    \'VifibSoftwareProductConstraint\', \'VifibSoftwareReleaseConstraint\',\n
    \'VifibSystemPreference\'\n
]\n
to_delete_id_list = []\n
\n
for id in unwanted_id_list:\n
   if id in id_list:\n
     to_delete_id_list.append(id)\n
if len(to_delete_id_list) > 0:\n
  portal_property_sheets.deleteContent(to_delete_id_list)\n
\n
def getPropertySheet(name):\n
  return portal_property_sheets.restrictedTraverse(name)\n
\n
# fix HostingSubscription\n
if \'root_software_release_url_property\' in getPropertySheet(\'HostingSubscription\'):\n
  getPropertySheet(\'HostingSubscription\').deleteContent(\'root_software_release_url_property\')\n
\n
# fix SlaveInstanceConstraint\n
for id in [\n
  \'destination_reference_property_existence_constraint\',\n
  \'reference_property_existence_constraint\',\n
  \'setup_packing_list_constraint\',\n
  \'text_content_existence_constraint\',\n
  ]:\n
  if id in getPropertySheet(\'SlaveInstanceConstraint\'):\n
    getPropertySheet(\'SlaveInstanceConstraint\').deleteContent(id)\n
\n
# fix SoftwareInstanceConstraint\n
for id in [\n
  \'destination_reference_property_existence_constraint\',\n
  \'reference_property_existence_constraint\', \n
  \'setup_packing_list_constraint\',\n
  \'ssl_certificate_constraint\',\n
  \'ssl_key_constraint\',\n
  ]:\n
  if id in getPropertySheet(\'SoftwareInstanceConstraint\'):\n
    getPropertySheet(\'SoftwareInstanceConstraint\').deleteContent(id)\n


]]></string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string></string> </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>ERP5Site_postUpgradeFixUpPortalPropertySheets</string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
