Commit 40a3cc36 authored by Łukasz Nowak's avatar Łukasz Nowak

Rebrand HS' periodicity constraints.

parent 0a34f141
<property_sheet_list>
<portal_type id="Hosting Subscription">
<item>SlapOSAccountingHostingSubscriptionConstraint</item>
</portal_type>
</property_sheet_list>
\ No newline at end of file
<workflow_chain>
<chain>
<type>Hosting Subscription</type>
<workflow>slapos_accounting_interaction_workflow</workflow>
</chain>
<chain>
<type>Subscription Item Root Simulation Rule</type>
<workflow>edit_workflow, rule_validation_workflow</workflow>
......
......@@ -32,7 +32,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>VifibHostingSubscriptionConstraint</string> </value>
<value> <string>SlapOSAccountingHostingSubscriptionConstraint</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Attribute Equality Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>constraint_attribute_name</string> </key>
<value> <string>periodicity_hour_list</string> </value>
</item>
<item>
<key> <string>constraint_attribute_value</string> </key>
<value> <string>python: [0]</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>periodicity_hour_list_value_constraint</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Attribute Equality Constraint</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Attribute Equality Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>constraint_attribute_name</string> </key>
<value> <string>periodicity_minute_list</string> </value>
</item>
<item>
<key> <string>constraint_attribute_value</string> </key>
<value> <string>python: [0]</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>periodicity_minute_list_value_constraint</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Attribute Equality Constraint</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TALES Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>expression</string> </key>
<value> <string>python: len(context.getPeriodicityMonthDayList()) == 1</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>periodicity_month_day_list_lenght_constraint</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>message_expression_false</string> </key>
<value> <string>There was too many objects in Edit this field periodicity_month_day_list</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>TALES Constraint</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.getPeriodicityMonthDay() is not None</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TALES Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>expression</string> </key>
<value> <string encoding="cdata"><![CDATA[
python: 1 <= context.getPeriodicityMonthDay() <= 28
]]></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>periodicity_month_day_value_range_constraint</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>message_expression_false</string> </key>
<value> <string>The periodicity_month_day value is not between 1 and 28 inclusive</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>TALES Constraint</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.getPeriodicityMonthDay() is not None</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -68,7 +68,7 @@
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<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: True</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -12,7 +12,6 @@ from Products.ERP5Type.DateUtils import addToDate
class TestHostingSubscriptionSimulation(testSlapOSMixin):
def _prepare(self):
self.login()
person = self.portal.person_module.template_member\
.Base_createCloneDocument(batch_mode=1)
self.subscription = self.portal.hosting_subscription_module\
......
......@@ -33,9 +33,7 @@
<item>
<key> <string>before_commit_script_name</string> </key>
<value>
<list>
<string>HostingSubscription_setUpPeriodicity</string>
</list>
<tuple/>
</value>
</item>
<item>
......@@ -50,13 +48,14 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>HostingSubscription_managerAfterAdd</string> </value>
<value> <string>HostingSubscription_afterAddClone</string> </value>
</item>
<item>
<key> <string>method_id</string> </key>
<value>
<list>
<string>manage_afterAdd</string>
<string>manage_afterClone</string>
</list>
</value>
</item>
......@@ -75,7 +74,9 @@
<item>
<key> <string>script_name</string> </key>
<value>
<tuple/>
<list>
<string>Base_fixConsistency</string>
</list>
</value>
</item>
<item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="InteractionDefinition" module="Products.ERP5.Interaction"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>activate_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>before_commit_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>HostingSubscription_fixConsistency</string> </value>
</item>
<item>
<key> <string>method_id</string> </key>
<value>
<list>
<string>fixConsistency</string>
</list>
</value>
</item>
<item>
<key> <string>once_per_transaction</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<list>
<string>Hosting Subscription</string>
</list>
</value>
</item>
<item>
<key> <string>script_name</string> </key>
<value>
<list>
<string>HostingSubscription_fixPeriodicity</string>
</list>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>state_change[\'object\'].fixConsistency()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_fixConsistency</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -54,19 +54,22 @@
from Products.ERP5Type.DateUtils import addToDate, getClosestDate\n
hosting_subscription = state_change[\'object\']\n
start_date = hosting_subscription.getCreationDate()\n
start_date = getClosestDate(target_date=start_date, precision=\'day\')\n
while start_date.day() >= 29:\n
\n
edit_kw = {}\n
\n
if hosting_subscription.getPeriodicityHour() is None:\n
edit_kw[\'periodicity_hour_list\'] = [0]\n
if hosting_subscription.getPeriodicityMinute() is None:\n
edit_kw[\'periodicity_minute_list\'] = [0]\n
if hosting_subscription.getPeriodicityMonthDay() is None:\n
start_date = hosting_subscription.getCreationDate()\n
start_date = getClosestDate(target_date=start_date, precision=\'day\')\n
while start_date.day() >= 29:\n
start_date = addToDate(start_date, to_add={\'day\': -1})\n
periodicity_month_day_list = [start_date.day()]\n
periodicity_hour_list=[0]\n
periodicity_minute_list=[0]\n
edit_kw[\'periodicity_month_day_list\'] = [start_date.day()]\n
\n
hosting_subscription.edit(\n
periodicity_month_day_list=periodicity_month_day_list,\n
periodicity_hour_list=periodicity_hour_list,\n
periodicity_minute_list=periodicity_minute_list\n
)\n
if edit_kw:\n
hosting_subscription.edit(**edit_kw)\n
]]></string> </value>
......@@ -85,7 +88,7 @@ hosting_subscription.edit(\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>HostingSubscription_setUpPeriodicity</string> </value>
<value> <string>HostingSubscription_fixPeriodicity</string> </value>
</item>
</dictionary>
</pickle>
......
26
\ No newline at end of file
27
\ No newline at end of file
Hosting Subscription | SlapOSAccountingHostingSubscriptionConstraint
\ No newline at end of file
Hosting Subscription | slapos_accounting_interaction_workflow
Subscription Item Root Simulation Rule | edit_workflow
Subscription Item Root Simulation Rule | rule_validation_workflow
\ No newline at end of file
SlapOSAccountingSystemPreference
SlapOSAccountingHostingSubscriptionConstraint
\ No newline at end of file
<property_sheet_list>
<portal_type id="Hosting Subscription">
<item>VifibHostingSubscriptionConstraint</item>
</portal_type>
<portal_type id="Internal Packing List">
<item>VifibInternalPackingListConstraint</item>
</portal_type>
......
565
\ No newline at end of file
566
\ No newline at end of file
Hosting Subscription | VifibHostingSubscriptionConstraint
Internal Packing List Line | VifibInternalPackingListLineConstraint
Internal Packing List | VifibInternalPackingListConstraint
Open Sale Order Line | VifibOpenSaleOrderLineConstraint
......
......@@ -9,6 +9,5 @@ VifibSaleInvoiceConstraint
VifibSalePackingListLineConstraint
VifibSalePackingListConstraint
VifibOpenSaleOrderLineConstraint
VifibHostingSubscriptionConstraint
VifibOpenSaleOrderConstraint
VifibObsoleteConstraint
\ No newline at end of file
......@@ -7,10 +7,6 @@
<type>Computer Partition</type>
<workflow>slap_interaction_workflow</workflow>
</chain>
<chain>
<type>Hosting Subscription</type>
<workflow>slap_interaction_workflow</workflow>
</chain>
<chain>
<type>Internal Packing List</type>
<workflow>slap_interaction_workflow</workflow>
......
872
\ No newline at end of file
873
\ No newline at end of file
Assignment | slap_interaction_workflow
Computer Partition | slap_interaction_workflow
Hosting Subscription | slap_interaction_workflow
Internal Packing List | slap_interaction_workflow
Open Sale Order | slap_interaction_workflow
Person | slap_interaction_workflow
......
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