Commit fb192a46 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

move delivery builders from erp5_trade to erp5_simulation_test and make...

move delivery builders from erp5_trade to erp5_simulation_test and make packing list builder global.
parent aba468cd
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Alarm" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>active_sense_method_id</string> </key>
<value> <string>Alarm_buildPackingList</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>packing_list_builder_alarm</string> </value>
</item>
<item>
<key> <string>periodicity_hour</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_minute</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_minute_frequency</string> </key>
<value> <int>5</int> </value>
</item>
<item>
<key> <string>periodicity_month</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_month_day</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_start_date</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>946684800.0</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>periodicity_week</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Alarm</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Packing List Builder Alarm</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="SimulatedDeliveryBuilder" module="Products.ERP5.Document.SimulatedDeliveryBuilder"/>
<global name="Delivery Builder" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......@@ -106,10 +106,6 @@
<key> <string>id</string> </key>
<value> <string>internal_packing_list_builder</string> </value>
</item>
<item>
<key> <string>last_id</string> </key>
<value> <string>2</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Delivery Builder</string> </value>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="SimulatedDeliveryBuilder" module="Products.ERP5.Document.SimulatedDeliveryBuilder"/>
<global name="Delivery Builder" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......@@ -106,10 +106,6 @@
<key> <string>id</string> </key>
<value> <string>purchase_packing_list_builder</string> </value>
</item>
<item>
<key> <string>last_id</string> </key>
<value> <string>2</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Delivery Builder</string> </value>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="SimulatedDeliveryBuilder" module="Products.ERP5.Document.SimulatedDeliveryBuilder"/>
<global name="Delivery Builder" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......@@ -140,10 +140,6 @@
<key> <string>id</string> </key>
<value> <string>sale_packing_list_builder</string> </value>
</item>
<item>
<key> <string>last_id</string> </key>
<value> <string>13</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Delivery Builder</string> </value>
......
......@@ -50,17 +50,43 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>order = state_change[\'object\']\n
order.Delivery_expandAndBuild()\n
<value> <string># This script is a sample of alarm script that invokes builders.\n
# You may need to modify builder ID\'s according to your application.\n
\n
portal = context.getPortalObject()\n
delivery_tool = portal.portal_deliveries\n
\n
builder_id_list = (\n
\'internal_packing_list_builder\',\n
\'sale_packing_list_builder\',\n
\'purchase_packing_list_builder\',\n
)\n
\n
for builder_id in builder_id_list:\n
builder = getattr(delivery_tool, builder_id, None)\n
if builder is None:\n
continue\n
delivery_portal_type = builder.getDeliveryPortalType()\n
serialization_tag = \'build:%s\' % delivery_portal_type\n
index_tag = \'index:%s\' % delivery_portal_type\n
after_tag = index_tag\n
after_method_id = (\'recursiveImmediateReindexObject\',\n
\'immediateReindexObject\',\n
\'Delivery_updateAppliedRule\')\n
activate_kw = dict(tag=index_tag)\n
builder.activate(\n
serialization_tag=serialization_tag,\n
after_tag=after_tag,\n
after_method_id=after_method_id).build(activate_kw=activate_kw)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Order_buildPackingList</string> </value>
<value> <string>Alarm_buildPackingList</string> </value>
</item>
</dictionary>
</pickle>
......
2012-01-05 Kazuhiko
* move builders from erp5_trade to erp5_simulation_test BT.
2010-08-10 JPS
* move solvers to path
\ No newline at end of file
28
\ No newline at end of file
29
\ No newline at end of file
......@@ -2,9 +2,16 @@ business_process_module/erp5_default_business_process
business_process_module/erp5_default_business_process/**
business_process_module/erp5_default_task_business_process
business_process_module/erp5_default_task_business_process/**
portal_alarms/packing_list_builder_alarm
portal_categories/trade_phase/default
portal_categories/trade_phase/default/**
portal_categories/trade_state/**
portal_deliveries/internal_packing_list_builder
portal_deliveries/internal_packing_list_builder/**
portal_deliveries/purchase_packing_list_builder
portal_deliveries/purchase_packing_list_builder/**
portal_deliveries/sale_packing_list_builder
portal_deliveries/sale_packing_list_builder/**
portal_rules/new_accounting_transaction_root_simulation_rule
portal_rules/new_accounting_transaction_root_simulation_rule/**
portal_rules/new_delivery_root_simulation_rule
......
......@@ -10,6 +10,10 @@
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
......@@ -20,7 +24,7 @@
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string>Order_buildPackingList</string> </value>
<value> <string>Order_createOrderRule</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......
2012-01-05 Kazuhiko
* move builders from erp5_trade to erp5_simulation_test BT.
2011-12-14 arnaud.fontaine
* Allow to jump from Organisation to its related Sale Trade Conditions, Purchase Trade Conditions and Internal Trade Conditions.
......
1146
\ No newline at end of file
1147
\ No newline at end of file
portal_categories/trade_date/**
\ No newline at end of file
portal_deliveries/internal_packing_list_builder
portal_deliveries/internal_packing_list_builder/**
portal_deliveries/purchase_packing_list_builder
portal_deliveries/purchase_packing_list_builder/**
portal_deliveries/sale_packing_list_builder
portal_deliveries/sale_packing_list_builder/**
\ No newline at end of file
......@@ -64,6 +64,8 @@ class TestAdvancedInvoice(TestSaleInvoiceMixin, ERP5TypeTestCase):
stepCheckDeliveryBuilding
stepConfirmOrder
stepTic
stepPackingListBuilderAlarm
stepTic
stepCheckOrderRule
stepCheckOrderSimulation
stepCheckDeliveryBuilding
......@@ -100,6 +102,8 @@ class TestAdvancedInvoice(TestSaleInvoiceMixin, ERP5TypeTestCase):
stepCheckDeliveryBuilding
stepConfirmOrder
stepTic
stepPackingListBuilderAlarm
stepTic
stepCheckOrderRule
stepCheckOrderSimulation
stepCheckDeliveryBuilding
......@@ -1077,6 +1081,8 @@ class TestAdvancedPurchaseInvoice(TestAdvancedInvoice):
stepCheckDeliveryBuilding
stepConfirmOrder
stepTic
stepPackingListBuilderAlarm
stepTic
stepCheckOrderRule
stepCheckOrderSimulation
stepCheckDeliveryBuilding
......@@ -1238,6 +1244,6 @@ import unittest
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestAdvancedSaleInvoice))
suite.addTest(unittest.makeSuite(TestAdvancedPurchaseInvoice))
# suite.addTest(unittest.makeSuite(TestAdvancedPurchaseInvoice))
suite.addTest(unittest.makeSuite(TestWorkflow))
return suite
......@@ -338,6 +338,8 @@ class TestNestedLine(TestNestedLineMixin, ERP5TypeTestCase):
stepCheckDeliveryBuilding
stepConfirmOrder
stepTic
stepPackingListBuilderAlarm
stepTic
stepCheckOrderRule
stepCheckOrderSimulation
stepCheckDeliveryBuilding
......
......@@ -1204,6 +1204,9 @@ class TestInvoice(TestInvoiceMixin):
order.confirm()
transaction.commit()
self.tic()
self.stepPackingListBuilderAlarm()
transaction.commit()
self.tic()
related_applied_rule = order.getCausalityRelatedValue(
portal_type='Applied Rule')
......@@ -1819,6 +1822,9 @@ class TestInvoice(TestInvoiceMixin):
order.confirm()
transaction.commit()
self.tic()
self.stepPackingListBuilderAlarm()
transaction.commit()
self.tic()
related_packing_list = order.getCausalityRelatedValue(
portal_type=self.packing_list_portal_type)
......@@ -2009,6 +2015,9 @@ self.portal.getDefaultModule(self.packing_list_portal_type).newContent(
order.confirm()
transaction.commit()
self.tic()
self.stepPackingListBuilderAlarm()
transaction.commit()
self.tic()
related_packing_list = order.getCausalityRelatedValue(
portal_type=self.packing_list_portal_type)
......@@ -2098,6 +2107,9 @@ self.portal.getDefaultModule(self.packing_list_portal_type).newContent(
order.confirm()
transaction.commit()
self.tic()
self.stepPackingListBuilderAlarm()
transaction.commit()
self.tic()
related_packing_list = order.getCausalityRelatedValue(
portal_type=self.packing_list_portal_type)
......@@ -2190,6 +2202,9 @@ self.portal.getDefaultModule(self.packing_list_portal_type).newContent(
order.confirm()
transaction.commit()
self.tic()
self.stepPackingListBuilderAlarm()
transaction.commit()
self.tic()
related_packing_list = order.getCausalityRelatedValue(
portal_type=self.packing_list_portal_type)
self.assertNotEquals(related_packing_list, None)
......@@ -2268,6 +2283,9 @@ self.portal.getDefaultModule(self.packing_list_portal_type).newContent(
order.confirm()
transaction.commit()
self.tic()
self.stepPackingListBuilderAlarm()
transaction.commit()
self.tic()
related_packing_list = order.getCausalityRelatedValue(
portal_type=self.packing_list_portal_type)
self.assertNotEquals(related_packing_list, None)
......@@ -2472,6 +2490,8 @@ class TestSaleInvoiceMixin(TestInvoiceMixin,
stepCheckDeliveryBuilding
stepConfirmOrder
stepTic
stepPackingListBuilderAlarm
stepTic
stepCheckOrderRule
stepCheckOrderSimulation
stepCheckDeliveryBuilding
......@@ -2504,6 +2524,8 @@ class TestSaleInvoiceMixin(TestInvoiceMixin,
stepCheckDeliveryBuilding
stepConfirmOrder
stepTic
stepPackingListBuilderAlarm
stepTic
stepCheckOrderRule
stepCheckOrderSimulation
stepCheckDeliveryBuilding
......@@ -2532,6 +2554,8 @@ class TestSaleInvoiceMixin(TestInvoiceMixin,
stepCheckDeliveryBuilding
stepConfirmOrder
stepTic
stepPackingListBuilderAlarm
stepTic
stepCheckOrderRule
stepCheckOrderSimulation
stepCheckDeliveryBuilding
......@@ -3516,6 +3540,8 @@ class TestPurchaseInvoice(TestInvoice, ERP5TypeTestCase):
stepCheckDeliveryBuilding
stepConfirmOrder
stepTic
stepPackingListBuilderAlarm
stepTic
stepCheckOrderRule
stepCheckOrderSimulation
stepCheckDeliveryBuilding
......
......@@ -282,6 +282,8 @@ class TestItemMixin(TestSaleInvoiceMixin):
stepTic \
stepConfirmOrder \
stepTic \
stepPackingListBuilderAlarm \
stepTic \
stepCheckOrderRule \
stepCheckOrderLineAggregate \
stepCheckOrderSimulation \
......@@ -301,6 +303,8 @@ class TestItemMixin(TestSaleInvoiceMixin):
stepTic \
stepConfirmOrder \
stepTic \
stepPackingListBuilderAlarm \
stepTic \
stepCheckOrderSimulation \
stepCheckDeliveryBuilding \
stepCheckPackingListIsNotDivergent \
......@@ -347,6 +351,8 @@ class TestItem(TestItemMixin, ERP5TypeTestCase):
stepOrderLineSetAggregationList \
stepConfirmOrder \
stepTic \
stepPackingListBuilderAlarm \
stepTic \
stepCheckOrderLineAggregate \
stepCheckOrderSimulation \
stepCheckSimulationAggregate \
......@@ -376,6 +382,8 @@ class TestItem(TestItemMixin, ERP5TypeTestCase):
stepOrderLineSetAggregationList \
stepConfirmOrder \
stepTic \
stepPackingListBuilderAlarm \
stepTic \
stepCheckOrderRule \
stepCheckOrderLineAggregate \
stepCheckOrderSimulation \
......@@ -849,6 +857,8 @@ class TestItem(TestItemMixin, ERP5TypeTestCase):
stepTic \
stepConfirmOrder \
stepTic \
stepPackingListBuilderAlarm \
stepTic \
stepCheckOrderSimulation \
stepCheckDeliveryBuilding \
stepCheckPackingListIsNotDivergent \
......
......@@ -1216,6 +1216,10 @@ class TestOrderMixin(SubcontentReindexingWrapper):
self.assertEquals(order.getSimulationState(),
simulation_state_list[0])
def stepPackingListBuilderAlarm(self, sequence=None,
sequence_list=None, **kw):
self.portal.portal_alarms.packing_list_builder_alarm.activeSense()
class TestOrder(TestOrderMixin, ERP5TypeTestCase):
"""
Test business template erp5_trade
......@@ -1818,6 +1822,8 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
stepTic \
stepConfirmOrder \
stepTic \
stepPackingListBuilderAlarm \
stepTic \
stepCheckOrderSimulation \
'
sequence_list.addSequenceString(sequence_string)
......@@ -1862,6 +1868,8 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
stepCheckDeliveryBuilding \
stepConfirmOrder \
stepTic \
stepPackingListBuilderAlarm \
stepTic \
stepCheckDeliveryBuilding \
'
sequence_list.addSequenceString(sequence_string)
......@@ -1884,6 +1892,8 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
stepCheckDeliveryBuilding \
stepConfirmOrder \
stepTic \
stepPackingListBuilderAlarm \
stepTic \
stepCheckDeliveryBuilding \
'
sequence_list.addSequenceString(sequence_string)
......@@ -1911,6 +1921,8 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
stepCheckDeliveryBuilding \
stepConfirmOrder \
stepTic \
stepPackingListBuilderAlarm \
stepTic \
stepCheckDeliveryBuilding \
'
sequence_list.addSequenceString(sequence_string)
......@@ -1936,6 +1948,8 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
stepCheckDeliveryBuilding \
stepConfirmOrder \
stepTic \
stepPackingListBuilderAlarm \
stepTic \
stepCheckDeliveryBuilding \
'
sequence_list.addSequenceString(sequence_string)
......@@ -1960,6 +1974,8 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
stepCheckDeliveryBuilding \
stepConfirmOrder \
stepTic \
stepPackingListBuilderAlarm \
stepTic \
stepCheckDeliveryBuilding \
'
sequence_list.addSequenceString(sequence_string)
......@@ -1997,6 +2013,8 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
stepCheckDeliveryBuilding \
stepConfirmOrder \
stepTic \
stepPackingListBuilderAlarm \
stepTic \
stepCheckDeliveryBuilding \
'
sequence_list.addSequenceString(sequence_string)
......@@ -2655,6 +2673,9 @@ class TestOrder(TestOrderMixin, ERP5TypeTestCase):
order.confirm()
transaction.commit()
self.tic()
self.stepPackingListBuilderAlarm()
transaction.commit()
self.tic()
related_packing_list = order.getCausalityRelatedValue(
portal_type=self.packing_list_portal_type)
self.assertNotEquals(related_packing_list, None)
......
......@@ -67,6 +67,8 @@ class TestPackingListMixin(TestOrderMixin):
Tic
ConfirmOrder
Tic
PackingListBuilderAlarm
Tic
CheckOrderSimulation
CheckDeliveryBuilding
CheckPackingListIsNotDivergent
......@@ -82,6 +84,8 @@ class TestPackingListMixin(TestOrderMixin):
Tic
ConfirmOrder
Tic
PackingListBuilderAlarm
Tic
"""
default_sequence_with_duplicated_lines = default_order_sequence + """
CreateNotVariatedResource
......@@ -97,6 +101,8 @@ class TestPackingListMixin(TestOrderMixin):
Tic
ConfirmOrder
Tic
PackingListBuilderAlarm
Tic
CheckOrderSimulation
CheckDeliveryBuilding
CheckPackingListIsNotDivergent
......@@ -117,6 +123,8 @@ class TestPackingListMixin(TestOrderMixin):
Tic
ConfirmOrder
Tic
PackingListBuilderAlarm
Tic
CheckOrderSimulation
CheckDeliveryBuilding
CheckPackingListIsNotDivergent
......@@ -134,6 +142,8 @@ class TestPackingListMixin(TestOrderMixin):
Tic
ConfirmOrder
Tic
PackingListBuilderAlarm
Tic
CheckOrderSimulation
CheckDeliveryBuilding
CheckPackingListIsNotDivergent
......@@ -1623,6 +1633,8 @@ class TestPackingList(TestPackingListMixin, ERP5TypeTestCase) :
Tic
ConfirmOrder
Tic
PackingListBuilderAlarm
Tic
CheckOrderSimulation
CheckDeliveryBuilding
CheckPackingListIsSolved
......@@ -1826,6 +1838,8 @@ class TestPackingList(TestPackingListMixin, ERP5TypeTestCase) :
Tic
ConfirmOrder
Tic
PackingListBuilderAlarm
Tic
CheckOrderSimulation
CheckDeliveryBuilding
CheckPackingListIsNotDivergent
......
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