Commit 7cec0b75 authored by Łukasz Nowak's avatar Łukasz Nowak

Rebrand default_payment_rule

parent f6e86758
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>vifib_payment_simulation_rule</string> </value> <value> <string>slapos_payment_simulation_rule</string> </value>
</item> </item>
<item> <item>
<key> <string>index</string> </key> <key> <string>index</string> </key>
...@@ -211,7 +211,7 @@ ...@@ -211,7 +211,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Vifib Payment Simulation Rule</string> </value> <value> <string>SlapOS Payment Simulation Rule</string> </value>
</item> </item>
<item> <item>
<key> <string>version</string> </key> <key> <string>version</string> </key>
...@@ -818,6 +818,51 @@ ...@@ -818,6 +818,51 @@
</value> </value>
</item> </item>
</dictionary> </dictionary>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>922.45108.39363.35447</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass> <reference id="10.1"/> </klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1353332454.35</float>
<string>GMT+1</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list> </list>
</tuple> </tuple>
</pickle> </pickle>
......
...@@ -51,11 +51,12 @@ ...@@ -51,11 +51,12 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <value> <string>portal = context.getPortalObject()\n
path_list = [q.PATH for q in portal.Base_getHostingSubscriptionForOpenSaleOrderLine(hosting_subscription_validation_state=\'validated\', open_sale_order_line_validation_state=\'validated\')]\n
path_list.extend([q.PATH for q in portal.Base_getHostingSubscriptionForOpenSaleOrderLine(hosting_subscription_validation_state=\'archived\', open_sale_order_line_validation_state=\'invalidated\')])\n
\n \n
portal.portal_catalog.searchAndActivate(\n portal.portal_catalog.searchAndActivate(\n
method_id=\'HostingSubscription_requestUpdateOpenSaleOrder\',\n method_id=\'HostingSubscription_requestUpdateOpenSaleOrder\',\n
portal_type="Hosting Subscription",\n path=path_list,\n
causality_state="diverged",\n
activate_kw={\'tag\': tag},\n activate_kw={\'tag\': tag},\n
packet_size=1, # HostingSubscription_trigger_Person_storeOpenSaleOrderJournal\n packet_size=1, # HostingSubscription_trigger_Person_storeOpenSaleOrderJournal\n
)\n )\n
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="SQL" module="Products.ZSQLMethods.SQL"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>allow_simple_one_argument_traversal</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string>hosting_subscription_validation_state\r\n
open_sale_order_line_validation_state</string> </value>
</item>
<item>
<key> <string>cache_time_</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>class_file_</string> </key>
<value> <string>ZSQLCatalog.zsqlbrain</string> </value>
</item>
<item>
<key> <string>class_name_</string> </key>
<value> <string>ZSQLBrain</string> </value>
</item>
<item>
<key> <string>connection_hook</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>connection_id</string> </key>
<value> <string>erp5_sql_connection</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getHostingSubscriptionForOpenSaleOrderLine</string> </value>
</item>
<item>
<key> <string>max_cache_</string> </key>
<value> <int>100</int> </value>
</item>
<item>
<key> <string>max_rows_</string> </key>
<value> <int>1000</int> </value>
</item>
<item>
<key> <string>src</string> </key>
<value> <string encoding="cdata"><![CDATA[
SELECT\n
catalog.uid, catalog.path\n
FROM catalog\n
LEFT JOIN category ON category.category_uid=catalog.uid AND category.base_category_uid=<dtml-var "portal_categories.aggregate.getUid()">\n
LEFT JOIN catalog AS order_catalog ON order_catalog.uid=category.uid AND order_catalog.portal_type=\'Open Sale Order Line\' AND order_catalog.validation_state=<dtml-sqlvar open_sale_order_line_validation_state type="string">\n
WHERE catalog.portal_type=\'Hosting Subscription\' and catalog.validation_state=<dtml-sqlvar hosting_subscription_validation_state type="string">\n
GROUP BY catalog.uid\n
HAVING count(order_catalog.uid) = 0\n
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -53,7 +53,6 @@ ...@@ -53,7 +53,6 @@
<value> <string>person = context.getDestinationSectionValue()\n <value> <string>person = context.getDestinationSectionValue()\n
if person is not None:\n if person is not None:\n
person.Person_storeOpenSaleOrderJournal()\n person.Person_storeOpenSaleOrderJournal()\n
context.converge()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -83,10 +83,11 @@ class TestOpenSaleOrderAlarm(testSlapOSMixin): ...@@ -83,10 +83,11 @@ class TestOpenSaleOrderAlarm(testSlapOSMixin):
for q in open_sale_order_template.getCategoryList()])) for q in open_sale_order_template.getCategoryList()]))
@simulateHostingSubscription_requestUpdateOpenSaleOrder @simulateHostingSubscription_requestUpdateOpenSaleOrder
def test_alarm_HS_diverged(self): def test_alarm_HS_validated(self):
subscription = self.portal.hosting_subscription_module\ subscription = self.portal.hosting_subscription_module\
.template_hosting_subscription.Base_createCloneDocument(batch_mode=1) .template_hosting_subscription.Base_createCloneDocument(batch_mode=1)
subscription.edit(reference='TESTHS-%s' % self.generateNewId()) subscription.edit(reference='TESTHS-%s' % self.generateNewId())
self.portal.portal_workflow._jumpToStateFor(subscription, 'validated')
self.tic() self.tic()
self.portal.portal_alarms\ self.portal.portal_alarms\
...@@ -97,6 +98,114 @@ class TestOpenSaleOrderAlarm(testSlapOSMixin): ...@@ -97,6 +98,114 @@ class TestOpenSaleOrderAlarm(testSlapOSMixin):
'Visited by HostingSubscription_requestUpdateOpenSaleOrder', 'Visited by HostingSubscription_requestUpdateOpenSaleOrder',
subscription.workflow_history['edit_workflow'][-1]['comment']) subscription.workflow_history['edit_workflow'][-1]['comment'])
@simulateHostingSubscription_requestUpdateOpenSaleOrder
def test_alarm_HS_validated_OSO_invalidated(self):
subscription = self.portal.hosting_subscription_module\
.template_hosting_subscription.Base_createCloneDocument(batch_mode=1)
subscription.edit(reference='TESTHS-%s' % self.generateNewId())
self.portal.portal_workflow._jumpToStateFor(subscription, 'validated')
open_sale_order = self.portal.open_sale_order_module\
.template_open_sale_order.Base_createCloneDocument(batch_mode=1)
open_sale_order.edit(reference='TESTOSO-%s' % self.generateNewId())
open_sale_order.newContent(portal_type='Open Sale Order Line',
aggregate=subscription.getRelativeUrl())
self.portal.portal_workflow._jumpToStateFor(open_sale_order, 'invalidated')
self.tic()
self.portal.portal_alarms\
.slapos_request_update_hosting_subscription_open_sale_order\
.activeSense()
self.tic()
self.assertEqual(
'Visited by HostingSubscription_requestUpdateOpenSaleOrder',
subscription.workflow_history['edit_workflow'][-1]['comment'])
@simulateHostingSubscription_requestUpdateOpenSaleOrder
def test_alarm_HS_archived(self):
subscription = self.portal.hosting_subscription_module\
.template_hosting_subscription.Base_createCloneDocument(batch_mode=1)
subscription.edit(reference='TESTHS-%s' % self.generateNewId())
self.portal.portal_workflow._jumpToStateFor(subscription, 'archived')
self.tic()
self.portal.portal_alarms\
.slapos_request_update_hosting_subscription_open_sale_order\
.activeSense()
self.tic()
self.assertEqual(
'Visited by HostingSubscription_requestUpdateOpenSaleOrder',
subscription.workflow_history['edit_workflow'][-1]['comment'])
@simulateHostingSubscription_requestUpdateOpenSaleOrder
def test_alarm_HS_archived_OSO_validated(self):
subscription = self.portal.hosting_subscription_module\
.template_hosting_subscription.Base_createCloneDocument(batch_mode=1)
subscription.edit(reference='TESTHS-%s' % self.generateNewId())
self.portal.portal_workflow._jumpToStateFor(subscription, 'archived')
open_sale_order = self.portal.open_sale_order_module\
.template_open_sale_order.Base_createCloneDocument(batch_mode=1)
open_sale_order.edit(reference='TESTOSO-%s' % self.generateNewId())
open_sale_order.newContent(portal_type='Open Sale Order Line',
aggregate=subscription.getRelativeUrl())
self.portal.portal_workflow._jumpToStateFor(open_sale_order, 'validated')
self.tic()
self.portal.portal_alarms\
.slapos_request_update_hosting_subscription_open_sale_order\
.activeSense()
self.tic()
self.assertEqual(
'Visited by HostingSubscription_requestUpdateOpenSaleOrder',
subscription.workflow_history['edit_workflow'][-1]['comment'])
@simulateHostingSubscription_requestUpdateOpenSaleOrder
def test_alarm_HS_validated_OSO_validated(self):
subscription = self.portal.hosting_subscription_module\
.template_hosting_subscription.Base_createCloneDocument(batch_mode=1)
subscription.edit(reference='TESTHS-%s' % self.generateNewId())
self.portal.portal_workflow._jumpToStateFor(subscription, 'validated')
open_sale_order = self.portal.open_sale_order_module\
.template_open_sale_order.Base_createCloneDocument(batch_mode=1)
open_sale_order.edit(reference='TESTOSO-%s' % self.generateNewId())
open_sale_order.newContent(portal_type='Open Sale Order Line',
aggregate=subscription.getRelativeUrl())
self.portal.portal_workflow._jumpToStateFor(open_sale_order, 'validated')
self.tic()
self.portal.portal_alarms\
.slapos_request_update_hosting_subscription_open_sale_order\
.activeSense()
self.tic()
self.assertNotEqual(
'Visited by HostingSubscription_requestUpdateOpenSaleOrder',
subscription.workflow_history['edit_workflow'][-1]['comment'])
@simulateHostingSubscription_requestUpdateOpenSaleOrder
def test_alarm_HS_archived_OSO_invalidated(self):
subscription = self.portal.hosting_subscription_module\
.template_hosting_subscription.Base_createCloneDocument(batch_mode=1)
subscription.edit(reference='TESTHS-%s' % self.generateNewId())
self.portal.portal_workflow._jumpToStateFor(subscription, 'archived')
open_sale_order = self.portal.open_sale_order_module\
.template_open_sale_order.Base_createCloneDocument(batch_mode=1)
open_sale_order.edit(reference='TESTOSO-%s' % self.generateNewId())
open_sale_order.newContent(portal_type='Open Sale Order Line',
aggregate=subscription.getRelativeUrl())
self.portal.portal_workflow._jumpToStateFor(open_sale_order, 'invalidated')
self.tic()
self.portal.portal_alarms\
.slapos_request_update_hosting_subscription_open_sale_order\
.activeSense()
self.tic()
self.assertNotEqual(
'Visited by HostingSubscription_requestUpdateOpenSaleOrder',
subscription.workflow_history['edit_workflow'][-1]['comment'])
class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin): class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
def test_empty_HostingSubscription(self): def test_empty_HostingSubscription(self):
person = self.portal.person_module.template_member\ person = self.portal.person_module.template_member\
...@@ -111,7 +220,6 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin): ...@@ -111,7 +220,6 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
subscription.HostingSubscription_requestUpdateOpenSaleOrder() subscription.HostingSubscription_requestUpdateOpenSaleOrder()
self.tic() self.tic()
self.assertEqual(subscription.getCausalityState(), 'solved')
open_sale_order_list = self.portal.portal_catalog( open_sale_order_list = self.portal.portal_catalog(
portal_type='Open Sale Order', portal_type='Open Sale Order',
...@@ -165,7 +273,6 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin): ...@@ -165,7 +273,6 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
subscription.HostingSubscription_requestUpdateOpenSaleOrder() subscription.HostingSubscription_requestUpdateOpenSaleOrder()
self.tic() self.tic()
self.assertEqual(subscription.getCausalityState(), 'solved')
open_sale_order_list = self.portal.portal_catalog( open_sale_order_list = self.portal.portal_catalog(
portal_type='Open Sale Order', portal_type='Open Sale Order',
...@@ -213,7 +320,6 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin): ...@@ -213,7 +320,6 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
'time': destroy_time, 'time': destroy_time,
'action': 'request_destroy' 'action': 'request_destroy'
}) })
subscription.diverge()
self.tic() self.tic()
subscription.HostingSubscription_requestUpdateOpenSaleOrder() subscription.HostingSubscription_requestUpdateOpenSaleOrder()
...@@ -295,7 +401,6 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin): ...@@ -295,7 +401,6 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
subscription.HostingSubscription_requestUpdateOpenSaleOrder() subscription.HostingSubscription_requestUpdateOpenSaleOrder()
self.tic() self.tic()
self.assertEqual(subscription.getCausalityState(), 'solved')
open_sale_order_list = self.portal.portal_catalog( open_sale_order_list = self.portal.portal_catalog(
portal_type='Open Sale Order', portal_type='Open Sale Order',
...@@ -355,7 +460,6 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin): ...@@ -355,7 +460,6 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
subscription.HostingSubscription_requestUpdateOpenSaleOrder() subscription.HostingSubscription_requestUpdateOpenSaleOrder()
self.tic() self.tic()
self.assertEqual(subscription.getCausalityState(), 'solved')
open_sale_order_list = self.portal.portal_catalog( open_sale_order_list = self.portal.portal_catalog(
portal_type='Open Sale Order', portal_type='Open Sale Order',
......
73 74
\ No newline at end of file \ No newline at end of file
...@@ -17,3 +17,4 @@ portal_rules/slapos_subscription_item_rule ...@@ -17,3 +17,4 @@ portal_rules/slapos_subscription_item_rule
portal_rules/slapos_invoice_simulation_rule portal_rules/slapos_invoice_simulation_rule
portal_rules/slapos_invoice_transaction_simulation_rule portal_rules/slapos_invoice_transaction_simulation_rule
portal_rules/slapos_trade_model_simulation_rule portal_rules/slapos_trade_model_simulation_rule
portal_rules/slapos_payment_simulation_rule
\ No newline at end of file
...@@ -32,6 +32,8 @@ portal_rules/slapos_invoice_simulation_rule ...@@ -32,6 +32,8 @@ portal_rules/slapos_invoice_simulation_rule
portal_rules/slapos_invoice_simulation_rule/** portal_rules/slapos_invoice_simulation_rule/**
portal_rules/slapos_invoice_transaction_simulation_rule portal_rules/slapos_invoice_transaction_simulation_rule
portal_rules/slapos_invoice_transaction_simulation_rule/** portal_rules/slapos_invoice_transaction_simulation_rule/**
portal_rules/slapos_payment_simulation_rule
portal_rules/slapos_payment_simulation_rule/**
portal_rules/slapos_subscription_item_rule portal_rules/slapos_subscription_item_rule
portal_rules/slapos_subscription_item_rule/** portal_rules/slapos_subscription_item_rule/**
portal_rules/slapos_trade_model_simulation_rule portal_rules/slapos_trade_model_simulation_rule
......
522 523
\ No newline at end of file \ No newline at end of file
135 136
\ No newline at end of file \ No newline at end of file
...@@ -2,4 +2,3 @@ portal_rules/vifib_delivery_simulation_rule ...@@ -2,4 +2,3 @@ portal_rules/vifib_delivery_simulation_rule
portal_rules/vifib_delivery_root_simulation_rule portal_rules/vifib_delivery_root_simulation_rule
portal_rules/vifib_invoice_root_simulation_rule portal_rules/vifib_invoice_root_simulation_rule
portal_rules/vifib_order_root_simulation_rule portal_rules/vifib_order_root_simulation_rule
portal_rules/vifib_payment_simulation_rule
\ No newline at end of file
...@@ -21,8 +21,6 @@ portal_rules/vifib_invoice_root_simulation_rule ...@@ -21,8 +21,6 @@ portal_rules/vifib_invoice_root_simulation_rule
portal_rules/vifib_invoice_root_simulation_rule/** portal_rules/vifib_invoice_root_simulation_rule/**
portal_rules/vifib_order_root_simulation_rule portal_rules/vifib_order_root_simulation_rule
portal_rules/vifib_order_root_simulation_rule/** portal_rules/vifib_order_root_simulation_rule/**
portal_rules/vifib_payment_simulation_rule
portal_rules/vifib_payment_simulation_rule/**
portal_solvers/Accept Solver portal_solvers/Accept Solver
portal_solvers/Accept Solver/* portal_solvers/Accept Solver/*
portal_solvers/Adopt Solver portal_solvers/Adopt Solver
......
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