Commit cacd3d2c authored by Łukasz Nowak's avatar Łukasz Nowak

Rebrand Open Sale Order manipulation.

Switch to fully alarm based approach and drop Person.fixConsistency interaction,
which created Open Sale Order.

As Open Sale Order is optional and it is asserted by alarm drop
open_sale_order_related_constraint.

Rename script to follow naming conventions.

Rename slapos_subscription to slapos_accounting in order to follow modularity
if SlapOS Master.
parent d05d8206
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>active_sense_method_id</string> </key> <key> <string>active_sense_method_id</string> </key>
<value> <string>Alarm_updatePersonOpenOrder</string> </value> <value> <string>Alarm_updatePersonOpenSaleOrder</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>vifib_person_update_open_order</string> </value> <value> <string>slapos_person_update_open_sale_order</string> </value>
</item> </item>
<item> <item>
<key> <string>periodicity_hour</string> </key> <key> <string>periodicity_hour</string> </key>
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>slapos_subscription</string> </value> <value> <string>slapos_accounting</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -67,10 +67,10 @@ if last_active_process is not None and not(params.get(\'full\', False)):\n ...@@ -67,10 +67,10 @@ if last_active_process is not None and not(params.get(\'full\', False)):\n
context.newActiveProcess()\n context.newActiveProcess()\n
\n \n
context.getPortalObject().portal_catalog.searchAndActivate(\n context.getPortalObject().portal_catalog.searchAndActivate(\n
method_id=\'Person_storeOpenOrderJournal\',\n method_id=\'Person_storeOpenSaleOrderJournal\',\n
method_kw={\'modification_date\': kw.get(\'modification_date\'), \'tag\': tag, \'stop_date\': params.get(\'stop_date\')},\n method_kw={\'modification_date\': kw.get(\'modification_date\'), \'tag\': tag, \'stop_date\': params.get(\'stop_date\')},\n
activate_kw={\'tag\': tag},\n activate_kw={\'tag\': tag},\n
packet_size=1, # Person_storeOpenOrderJournal generates big transactions\n packet_size=1, # Person_storeOpenSaleOrderJournal generates big transactions\n
portal_type=\'Person\',\n portal_type=\'Person\',\n
**search_kw\n **search_kw\n
)\n )\n
...@@ -84,7 +84,7 @@ context.activate(after_tag=tag).getId()\n ...@@ -84,7 +84,7 @@ context.activate(after_tag=tag).getId()\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Alarm_updatePersonOpenOrder</string> </value> <value> <string>Alarm_updatePersonOpenSaleOrder</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -6,6 +6,27 @@ ...@@ -6,6 +6,27 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<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/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item> <item>
<key> <string>action</string> </key> <key> <string>action</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
......
...@@ -179,7 +179,7 @@ return add_kw_kw, modify_kw_kw, list(remove_id_list)\n ...@@ -179,7 +179,7 @@ return add_kw_kw, modify_kw_kw, list(remove_id_list)\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Person_getOpenOrderDifference</string> </value> <value> <string>Person_getOpenSaleOrderDifference</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -102,7 +102,7 @@ for hosting_subscription in portal.portal_catalog(\n ...@@ -102,7 +102,7 @@ for hosting_subscription in portal.portal_catalog(\n
start_date_tuple_list.append((hosting_subscription.getRelativeUrl(), start_date, hosting_subscription.getPath()))\n start_date_tuple_list.append((hosting_subscription.getRelativeUrl(), start_date, hosting_subscription.getPath()))\n
\n \n
\n \n
result = context.Person_updateOpenOrder(src__=src__, remove_hosting_list=remove_hosting_list, add_kw_list=add_kw_list, start_date_tuple_list=start_date_tuple_list, stop_date=stop_date)\n result = context.Person_updateOpenSaleOrder(src__=src__, remove_hosting_list=remove_hosting_list, add_kw_list=add_kw_list, start_date_tuple_list=start_date_tuple_list, stop_date=stop_date)\n
from pprint import pformat\n from pprint import pformat\n
return pformat(result)\n return pformat(result)\n
</string> </value> </string> </value>
...@@ -113,7 +113,7 @@ return pformat(result)\n ...@@ -113,7 +113,7 @@ return pformat(result)\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Person_storeOpenOrderJournal</string> </value> <value> <string>Person_storeOpenSaleOrderJournal</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -56,7 +56,7 @@ from DateTime import DateTime\n ...@@ -56,7 +56,7 @@ from DateTime import DateTime\n
\n \n
person = context\n person = context\n
portal = person.getPortalObject()\n portal = person.getPortalObject()\n
tag = \'%s_updateOpenOrder\' % person.getUid()\n tag = \'%s_updateOpenSaleOrder\' % person.getUid()\n
activate_kw = {\'tag\': tag}\n activate_kw = {\'tag\': tag}\n
if portal.portal_activities.countMessageWithTag(tag) > 0:\n if portal.portal_activities.countMessageWithTag(tag) > 0:\n
# nothing to do\n # nothing to do\n
...@@ -65,7 +65,7 @@ if portal.portal_activities.countMessageWithTag(tag) > 0:\n ...@@ -65,7 +65,7 @@ if portal.portal_activities.countMessageWithTag(tag) > 0:\n
def storeWorkflowComment(document, comment):\n def storeWorkflowComment(document, comment):\n
portal.portal_workflow.doActionFor(document, \'edit_action\', comment=comment)\n portal.portal_workflow.doActionFor(document, \'edit_action\', comment=comment)\n
\n \n
add_kw_kw, modify_kw_kw, remove_id_list = context.Person_getOpenOrderDifference(\n add_kw_kw, modify_kw_kw, remove_id_list = context.Person_getOpenSaleOrderDifference(\n
remove_hosting_list=remove_hosting_list, add_kw_list=add_kw_list,\n remove_hosting_list=remove_hosting_list, add_kw_list=add_kw_list,\n
stop_date=stop_date, start_date_tuple_list=start_date_tuple_list)\n stop_date=stop_date, start_date_tuple_list=start_date_tuple_list)\n
\n \n
...@@ -87,7 +87,7 @@ if previous_open_sale_order is None:\n ...@@ -87,7 +87,7 @@ if previous_open_sale_order is None:\n
destination=person.getRelativeUrl(),\n destination=person.getRelativeUrl(),\n
price_currency=\'currency_module/EUR\',\n price_currency=\'currency_module/EUR\',\n
specialise=\'sale_trade_condition_module/vifib_trade_condition\',\n specialise=\'sale_trade_condition_module/vifib_trade_condition\',\n
title="ViFiB Open Order",\n title="SlapOS Subscription Open Sale Order",\n
effective_date=now,\n effective_date=now,\n
activate_kw=activate_kw)\n activate_kw=activate_kw)\n
open_sale_order.order(activate_kw=activate_kw)\n open_sale_order.order(activate_kw=activate_kw)\n
...@@ -133,7 +133,7 @@ return add_kw_kw, modify_kw_kw, remove_id_list\n ...@@ -133,7 +133,7 @@ return add_kw_kw, modify_kw_kw, remove_id_list\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Person_updateOpenOrder</string> </value> <value> <string>Person_updateOpenSaleOrder</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
Accounting for SlapOS Master.
\ No newline at end of file
2
\ No newline at end of file
...@@ -3,6 +3,7 @@ organisation_module/vifib_client_A/** ...@@ -3,6 +3,7 @@ organisation_module/vifib_client_A/**
organisation_module/vifib_internet organisation_module/vifib_internet
organisation_module/vifib_internet/1 organisation_module/vifib_internet/1
organisation_module/vifib_internet/bank_account organisation_module/vifib_internet/bank_account
portal_alarms/slapos_person_update_open_sale_order
purchase_trade_condition_module/vifib_purchase_trade_condition purchase_trade_condition_module/vifib_purchase_trade_condition
purchase_trade_condition_module/vifib_purchase_trade_condition/** purchase_trade_condition_module/vifib_purchase_trade_condition/**
sale_trade_condition_module/vifib_trade_condition sale_trade_condition_module/vifib_trade_condition
......
slapos_accounting
\ No newline at end of file
slapos_accounting
\ No newline at end of file
Subscription management for SlapOS.
\ No newline at end of file
slapos_subscription
\ No newline at end of file
slapos_subscription
\ No newline at end of file
Vifib 0.5
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category Related Membership Arity 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_base_category</string> </key>
<value>
<tuple>
<string>default_destination_section</string>
</tuple>
</value>
</item>
<item>
<key> <string>constraint_portal_type</string> </key>
<value> <string>python: (\'Open Sale Order\',)</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>filter_parameter</string> </key>
<value> <string>python: {\'validation_state\': \'validated\'}</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>open_sale_order_related_constraint</string> </value>
</item>
<item>
<key> <string>max_arity</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>min_arity</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category Related Membership Arity Constraint</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>
552 553
\ No newline at end of file \ No newline at end of file
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
<value> <value>
<list> <list>
<string>Person_createOngoingInvoice</string> <string>Person_createOngoingInvoice</string>
<string>Person_createOpenOrder</string>
<string>Person_createRegistrationInvoice</string> <string>Person_createRegistrationInvoice</string>
</list> </list>
</value> </value>
......
<?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>person = state_change[\'object\']\n
person.Person_updateOpenOrder()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Person_createOpenOrder</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
vifib_base vifib_base
slapos_subscription slapos_accounting
\ No newline at end of file \ No newline at end of file
868 869
\ No newline at end of file \ No newline at end of file
...@@ -9,7 +9,6 @@ portal_alarms/vifib_check_consistency ...@@ -9,7 +9,6 @@ portal_alarms/vifib_check_consistency
portal_alarms/vifib_clone_destroy_partition portal_alarms/vifib_clone_destroy_partition
portal_alarms/vifib_lock_person portal_alarms/vifib_lock_person
portal_alarms/vifib_lock_software_instance portal_alarms/vifib_lock_software_instance
portal_alarms/vifib_person_update_open_order
portal_alarms/vifib_request_destruction_selenium_tester_instance portal_alarms/vifib_request_destruction_selenium_tester_instance
portal_alarms/vifib_set_priority_one_message_table portal_alarms/vifib_set_priority_one_message_table
portal_alarms/vifib_trigger_build portal_alarms/vifib_trigger_build
......
...@@ -122,7 +122,7 @@ REQUIRED_BT5_ID_LIST = (\n ...@@ -122,7 +122,7 @@ REQUIRED_BT5_ID_LIST = (\n
\'vifib_data\',\n \'vifib_data\',\n
\'vifib_data_web\',\n \'vifib_data_web\',\n
\'vifib_data_simulation\',\n \'vifib_data_simulation\',\n
\'slapos_subscription\',\n \'slapos_accounting\',\n
\'slapos_erp5\',\n \'slapos_erp5\',\n
)\n )\n
\n \n
......
162 163
\ No newline at end of file \ No newline at end of file
...@@ -93,7 +93,7 @@ class testVifibMixin(ERP5TypeTestCase): ...@@ -93,7 +93,7 @@ class testVifibMixin(ERP5TypeTestCase):
'erp5_accounting_l10n_fr', 'erp5_accounting_l10n_fr',
'erp5_web_shacache', 'erp5_web_shacache',
'erp5_data_set', 'erp5_data_set',
'slapos_subscription', 'slapos_accounting',
'vifib_base', 'vifib_base',
'erp5_workflow', 'erp5_workflow',
'erp5_web_shadir', 'erp5_web_shadir',
......
...@@ -24,7 +24,7 @@ class SlapOSCloud(SavedTestSuite, ProjectTestSuite): ...@@ -24,7 +24,7 @@ class SlapOSCloud(SavedTestSuite, ProjectTestSuite):
'slapos_cache', 'slapos_cache',
'slapos_erp5', 'slapos_erp5',
'slapos_pdm', 'slapos_pdm',
'slapos_subscription', 'slapos_accounting',
'slapos_slap_tool', 'slapos_slap_tool',
'slapos_rest_api', 'slapos_rest_api',
'slapos_web', 'slapos_web',
......
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