<globalname="Property Existence Constraint"module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
...
...
@@ -19,18 +19,24 @@
</value>
</item>
<item>
<key><string>description</string></key>
<key><string>constraint_property</string></key>
<value>
<none/>
<tuple>
<string>periodicity_hour</string>
<string>periodicity_minute</string>
<string>periodicity_month_day</string>
</tuple>
</value>
</item>
<item>
<key><string>expression</string></key>
<value><string>python: len(context.getAggregateValue(portal_type=\'Hosting Subscription\').getAggregateRelatedList(portal_type=\'Open Sale Order Line\')) == 1</string></value>
<value><string>Hosting Subscription related to Sale Order Line have to be related with exactly 1 Open Sale Order Line</string></value>
</item>
<item>
<key><string>portal_type</string></key>
<value><string>TALES Constraint</string></value>
<value><string>Property Existence Constraint</string></value>
</item>
<item>
<key><string>string_index</string></key>
...
...
@@ -70,7 +68,7 @@
</item>
<item>
<key><string>test_tales_expression</string></key>
<value><string>python: context.getSimulationState() in context.getPortalPlannedOrderStateList() and context.getAggregateValue(portal_type=\'Hosting Subscription\') is not None</string></value>
<value><string>python: context.getPortalObject().portal_catalog.getResultValue(portal_type=\'Sale Packing List Line\', default_aggregate_uid=context.getUid(), default_resource_uid=context.getPortalObject().restrictedTraverse(context.getPortalObject().portal_preferences.getPreferredInstanceSetupResource()).getUid(), simulation_state=(\'stopped\', \'delivered\')) is not None</string></value>
<value><string>python: object.getResourceValue() is not None and object.getResource() in [object.portal_preferences.getPreferredInstanceSetupResource(), object.portal_preferences.getPreferredInstanceHostingResource(), object.portal_preferences.getPreferredInstanceCleanupResource()]</string></value>
<value><string>python: object.getSimulationState() == \'confirmed\' and object.getResourceValue() is not None and object.getResource() in [object.portal_preferences.getPreferredInstanceSetupResource(), object.portal_preferences.getPreferredInstanceHostingResource(), object.portal_preferences.getPreferredInstanceCleanupResource()]</string></value>
<value><string>python: object.getResourceValue() is not None and object.getResource() in [object.portal_preferences.getPreferredInstanceSetupResource(), object.portal_preferences.getPreferredInstanceHostingResource(), object.portal_preferences.getPreferredInstanceCleanupResource()]</string></value>
<value><string>python: object.getResourceValue() is not None and object.getResource() in [object.portal_preferences.getPreferredInstanceSetupResource(), object.portal_preferences.getPreferredInstanceHostingResource(), object.portal_preferences.getPreferredInstanceCleanupResource()]</string></value>
<value><string>python: object.getResourceValue() is not None and object.getResource() in [object.portal_preferences.getPreferredInstanceSetupResource(), object.portal_preferences.getPreferredInstanceHostingResource(), object.portal_preferences.getPreferredInstanceCleanupResource()]</string></value>
existing = portal.portal_catalog.countResults(portal_type=\'Open Sale Order Line\', default_aggregate_uid=portal.restrictedTraverse(add_kw[\'aggregate\']).getUid())[0][0] > 0\n
if add_kw[\'aggregate\'] not in hosting_subscription_mapping and not existing:\n
@@ -90,9 +90,6 @@ for sale_packing_list_line in portal.portal_catalog(\n
sale_packing_list.deliver()\n
if sale_packing_list.getSimulationState() != \'delivered\':\n
raise ValueError(\'It was not possible to deliver %r during destruction of %r\' % (sale_packing_list.getRelativeUrl(), software_instance.getRelativeUrl()))\n
open_order_uid_list = [x.uid for x in portal.portal_catalog(\n
portal_type="Open Sale Order",\n
simulation_state="started",\n
default_destination_section_uid=person_uid)\n
]\n
\n
return portal.portal_catalog(\n
portal_type="Open Sale Order Line",\n
parent_uid=open_order_uid_list,\n
parent_uid=portal.portal_catalog.getResultValue(portal_type=\'Open Sale Order\', default_destination_decision_uid=person_uid, validation_state=\'validated\').getUid(),\n
python: not here.portal_membership.isAnonymousUser() and (here.portal_catalog.countResults(portal_type=\'Payment Transaction\', default_destination_section_uid=here.ERP5Site_getAuthenticatedMemberPersonValue().getUid())[0][0] > 1 or (here.portal_catalog.countResults(portal_type=\'Payment Transaction\', default_destination_section_uid=here.ERP5Site_getAuthenticatedMemberPersonValue().getUid())[0][0] == 1 and here.portal_catalog.portal_catalog(portal_type=\'Payment Transaction\', default_destination_section_uid=here.ERP5Site_getAuthenticatedMemberPersonValue().getUid())[0].getSimulationState() not in [\'confirmed\', \'planned\']))
]]></string></value>
<value><string>python: not here.portal_membership.isAnonymousUser()</string></value>
<value><string>python: not here.portal_membership.isAnonymousUser() and here.ERP5Site_getInitialPlannedPaymentTransaction() is not None</string></value>
<value><string>python: not here.portal_membership.isAnonymousUser() and here.portal_catalog.countResults(portal_type=\'Payment Transaction\', default_destination_section_uid=here.ERP5Site_getAuthenticatedMemberPersonValue().getUid())[0][0] == 1 and here.portal_catalog(portal_type=\'Payment Transaction\', default_destination_section_uid=here.ERP5Site_getAuthenticatedMemberPersonValue().getUid())[0].getSimulationState() == \'confirmed\'</string></value>
<value><string>python: not here.portal_membership.isAnonymousUser() and here.portal_catalog.countResults(portal_type=\'Payment Transaction\', default_destination_section_uid=here.ERP5Site_getAuthenticatedMemberPersonValue().getUid())[0][0] == 0</string></value>