diff --git a/master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_simulation/VifibDeliveryBuilder_selectMovement.xml b/master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_simulation/VifibDeliveryBuilder_selectMovement.xml
index 9bb8328cd673d07dfe4db6a5d19e93b6b0d21e4c..4a3fa1520eb53b23d1f9d1ab106e28b02e7a5740 100644
--- a/master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_simulation/VifibDeliveryBuilder_selectMovement.xml
+++ b/master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_simulation/VifibDeliveryBuilder_selectMovement.xml
@@ -320,25 +320,15 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string encoding="cdata"><![CDATA[
-
-from Products.ERP5Type.DateUtils import getClosestDate\n
-from DateTime import DateTime\n
-\n
-# support build_before\n
-build_before = kw.pop(\'build_before\', None)\n
-if build_before is None:\n
-  build_before = getClosestDate(target_date=DateTime(), precision=\'month\', before=0)\n
-kw[\'movement.start_date\'] = \'< %s\' % build_before\n
-\n
+            <value> <string>select_dict= {\'delivery_uid\': None}\n
+kw[\'select_dict\']=select_dict\n
+kw[\'left_join_list\']=select_dict.keys()\n
+kw[\'delivery_uid\']=None\n
 if src__==0:\n
   return context.portal_catalog(**kw)\n
-\n
 else:\n
   return context.portal_catalog(src__=1, **kw)\n
-
-
-]]></string> </value>
+</string> </value>
         </item>
         <item>
             <key> <string>_params</string> </key>
diff --git a/master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_simulation/VifibInvoiceBuilder_selectPlannedSaleInvoiceList.xml b/master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_simulation/VifibInvoiceBuilder_selectPlannedSaleInvoiceList.xml
index bba767d9421243b9af04d706a4c5e556fad5317b..94761b55da16715b9f1bc7b98a8f5ec6487eeb06 100644
--- a/master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_simulation/VifibInvoiceBuilder_selectPlannedSaleInvoiceList.xml
+++ b/master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_simulation/VifibInvoiceBuilder_selectPlannedSaleInvoiceList.xml
@@ -50,14 +50,12 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>portal = context.getPortalObject()\n
-accounting_module = portal.getDefaultModule(\'Sale Invoice Transaction\')\n
-\n
-invoice = accounting_module.searchFolder(\n
+            <value> <string>portal_catalog = context.getPortalObject().portal_catalog\n
+simulation_state = \'planned\'\n
+# use catalog to prefetch, but check later in ZODB\n
+return [q.getObject() for q in portal_catalog(\n
     portal_type=\'Sale Invoice Transaction\',\n
-    simulation_state=\'planned\')\n
-\n
-return invoice\n
+    simulation_state=simulation_state) if q.getSimulationState() == simulation_state]\n
 </string> </value>
         </item>
         <item>
diff --git a/master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_simulation/VifibInvoiceTransaction_postGeneration.xml b/master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_simulation/VifibInvoiceTransaction_postGeneration.xml
index a110f1b9a363e73ed2d4536c8ef68e67e89808e3..139f72dbbe6ca1af02e87459ded001c03a245e7d 100644
--- a/master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_simulation/VifibInvoiceTransaction_postGeneration.xml
+++ b/master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_simulation/VifibInvoiceTransaction_postGeneration.xml
@@ -50,20 +50,10 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string encoding="cdata"><![CDATA[
-
-"""This script is called on the Invoice after the delivery builder has created\n
+            <value> <string>"""This script is called on the Invoice after the delivery builder has created\n
 the new Invoice.\n
 """\n
 from Products.ERP5Type.Message import translateString\n
-try:\n
-  from Products.CMFCore.WorkflowCore import WorkflowException\n
-except ImportError:\n
-  # WorkflowException has not always been allowed in restricted\n
-  # environment, in this case, make sure WorkflowException is \n
-  # defined \n
-  class WorkflowException(Exception):\n
-    pass\n
 \n
 if related_simulation_movement_path_list is None:\n
   raise RuntimeError, \'related_simulation_movement_path_list is missing. Update ERP5 Product.\'\n
@@ -75,60 +65,17 @@ if not invoice.Invoice_isAdvanced():\n
   if not invoice.getResource():\n
     invoice.setResource(invoice.getPriceCurrency())\n
 \n
-related_packing_list = invoice.getDefaultCausalityValue()\n
-related_order = related_packing_list.getDefaultCausalityValue()\n
-\n
-# copy payment conditions from packing list\n
-# if missing, try to copy from order (for compatibility)\n
-if not invoice.contentValues(portal_type=\'Payment Condition\'):\n
-  payment_condition_copy_id_list = []\n
-  if related_packing_list is not None:\n
-    payment_condition_copy_id_list = related_packing_list.contentIds(filter={\'portal_type\':\'Payment Condition\'})\n
-  if len(payment_condition_copy_id_list) > 0:\n
-    clipboard = related_packing_list.manage_copyObjects(ids=payment_condition_copy_id_list)\n
-    invoice.manage_pasteObjects(clipboard)\n
-  elif related_order is not None:\n
-    payment_condition_copy_id_list = related_order.contentIds(\n
-      filter={\'portal_type\':\'Payment Condition\'})\n
-    if len(payment_condition_copy_id_list) > 0:\n
-      clipboard = related_order.manage_copyObjects(ids=payment_condition_copy_id_list)\n
-      invoice.manage_pasteObjects(clipboard)\n
-\n
-if related_order is not None and context.portal_skins.hasObject(\'erp5_simulation_legacy\'):\n
-  # copy trade condition:\n
-  if not context.getSpecialise():\n
-    context.edit(specialise=related_order.getSpecialise())\n
-  \n
-  # copy order\'s trade model lines\n
-  invoice_trade_model_line_reference_list = [document.getReference() \\\n
-      for document in context.contentValues(portal_type=\'Trade Model Line\')]\n
-  order_trade_model_line_copy_id_list = []\n
-  for order_trade_model_line in related_order.contentValues(\n
-      portal_type=\'Trade Model Line\'):\n
-    if order_trade_model_line.getReference() not in \\\n
-        invoice_trade_model_line_reference_list:\n
-      order_trade_model_line_copy_id_list.append(order_trade_model_line.getId())\n
-  \n
-  if order_trade_model_line_copy_id_list:\n
-    clipboard = related_order.manage_copyObjects(\n
-      ids=order_trade_model_line_copy_id_list)\n
-    context.manage_pasteObjects(clipboard)\n
-  \n
-# copy title, if not updating a new delivery\n
-if not invoice.hasTitle() and related_packing_list.hasTitle():\n
-  invoice.setTitle(related_packing_list.getTitle())\n
-\n
-# initialize accounting_workflow to confirmed state\n
-confirm_tag = \'%s_confirm\' % invoice.getPath()\n
+# initialize accounting_workflow to planned state\n
+plan_tag = \'%s_plan\' % invoice.getPath()\n
 if invoice.getSimulationState() == \'draft\':\n
   invoice.activate(after_path_and_method_id=(related_simulation_movement_path_list,\n
   (\'immediateReindexObject\',\'recursiveImmediateReindexObject\')),\n
-  tag=confirm_tag).Delivery_confirm()\n
+  tag=plan_tag).plan(comment=translateString(\'Initialised by Delivery Builder.\'))\n
 else:\n
-  # call builder just same as after script of \'confirm\' transition\n
+  # call builder just same as after script of \'plan\' transition\n
   invoice.activate(after_path_and_method_id=(related_simulation_movement_path_list,\n
   (\'immediateReindexObject\',\'recursiveImmediateReindexObject\')),\n
-  tag=confirm_tag).Delivery_expandAndBuild()\n
+  tag=plan_tag).Delivery_expandAndBuild()\n
 \n
 # First set the invoice in the building state on the causality workflow\n
 invoice.startBuilding()\n
@@ -136,10 +83,22 @@ invoice.startBuilding()\n
 # Then an activity should put the causality state in diverged or solved\n
 invoice.activate(after_path_and_method_id=(related_simulation_movement_path_list,\n
   (\'immediateReindexObject\',\'recursiveImmediateReindexObject\')),\n
-  after_tag=confirm_tag).updateCausalityState()\n
-
-
-]]></string> </value>
+  after_tag=plan_tag).updateCausalityState()\n
+\n
+# update casuality from movements\n
+causality_list = invoice.getCausalityList()\n
+causality_list.sort()\n
+modified = 0\n
+for movement in invoice.getMovementList(portal_type=\'Invoice Line\'):\n
+  movement_causality = movement.getCausality()\n
+  if movement_causality not in causality_list:\n
+    modified = 1\n
+    causality_list.append(movement_causality)\n
+\n
+if modified:\n
+  causality_list.sort()\n
+  invoice.setCausalityList(causality_list)\n
+</string> </value>
         </item>
         <item>
             <key> <string>_params</string> </key>
diff --git a/master/bt5/vifib_base/bt/revision b/master/bt5/vifib_base/bt/revision
index 91a3d4243df1581626c3a06d2332405e0241720b..387c46fdec89e3cb2d1358c93270eeeeec85d13f 100644
--- a/master/bt5/vifib_base/bt/revision
+++ b/master/bt5/vifib_base/bt/revision
@@ -1 +1 @@
-340
\ No newline at end of file
+346
\ No newline at end of file
diff --git a/master/bt5/vifib_data/PathTemplateItem/service_module/vifib_usage_report.xml b/master/bt5/vifib_data/PathTemplateItem/service_module/vifib_usage_report.xml
index 7953d46018270245dca56ae7c36539b8964fa7ae..232f5a262124e98ec8bf54f73ebe5b2df0337bab 100644
--- a/master/bt5/vifib_data/PathTemplateItem/service_module/vifib_usage_report.xml
+++ b/master/bt5/vifib_data/PathTemplateItem/service_module/vifib_usage_report.xml
@@ -63,9 +63,7 @@
         <item>
             <key> <string>aggregated_portal_type</string> </key>
             <value>
-              <tuple>
-                <string>Usage Report</string>
-              </tuple>
+              <tuple/>
             </value>
         </item>
         <item>
diff --git a/master/bt5/vifib_data/bt/revision b/master/bt5/vifib_data/bt/revision
index 9f728587959d189de8b5dcadab2b3aec1276a169..7730ef7f3e0586b9070623baed6032dff904c9ea 100644
--- a/master/bt5/vifib_data/bt/revision
+++ b/master/bt5/vifib_data/bt/revision
@@ -1 +1 @@
-88
\ No newline at end of file
+89
\ No newline at end of file
diff --git a/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/account_credit_path.xml b/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/account_credit_path.xml
index ff4c0249c316e16db42c709caf53b5d03c7b6ba7..77adc0f5ecdb55c4b35574388f70e9a24c194bcc 100644
--- a/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/account_credit_path.xml
+++ b/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/account_credit_path.xml
@@ -50,7 +50,6 @@
             <value>
               <tuple>
                 <string>trade_phase/vifib/accounting</string>
-                <string>trade_date/trade_phase/vifib/invoicing</string>
                 <string>source/account_module/sales</string>
                 <string>destination/account_module/purchase</string>
               </tuple>
diff --git a/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/account_debit_path.xml b/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/account_debit_path.xml
index 2f0466202f24f8b5b6b007a21492c8df059bfe21..9a1c12c10b0f8aa77727340a41a410b5da7cd4b3 100644
--- a/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/account_debit_path.xml
+++ b/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/account_debit_path.xml
@@ -50,7 +50,6 @@
             <value>
               <tuple>
                 <string>trade_phase/vifib/accounting</string>
-                <string>trade_date/trade_phase/vifib/invoicing</string>
                 <string>source/account_module/receivable</string>
                 <string>destination/account_module/payable</string>
               </tuple>
diff --git a/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/deliver.xml b/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/deliver.xml
index fad2b85badfd1027d44bca41f76f2f5d85c349b0..ef0fbe71ea8af1fe4c917ec6a646ed68ee458797 100644
--- a/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/deliver.xml
+++ b/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/deliver.xml
@@ -114,9 +114,7 @@
             <key> <string>completed_state</string> </key>
             <value>
               <tuple>
-                <string>confirmed</string>
                 <string>delivered</string>
-                <string>started</string>
                 <string>stopped</string>
               </tuple>
             </value>
diff --git a/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/delivery_path.xml b/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/delivery_path.xml
index c02d2bee07b49ab9b4556e71ba30fe486ecf4dff..2f862e3e3d7cc863189db4cedbb71edb9a085a5a 100644
--- a/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/delivery_path.xml
+++ b/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/delivery_path.xml
@@ -70,7 +70,6 @@
             <value>
               <tuple>
                 <string>trade_phase/vifib/delivery</string>
-                <string>trade_date/trade_phase/vifib/order</string>
                 <string>end_of/day</string>
               </tuple>
             </value>
diff --git a/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/invoice_path.xml b/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/invoice_path.xml
index 089ef617bc8d0cdae12489b4713793446ea8b9ed..e950e75da9f5c5439df19ff060e974ca37cf3c05 100644
--- a/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/invoice_path.xml
+++ b/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/invoice_path.xml
@@ -49,7 +49,6 @@
             <key> <string>categories</string> </key>
             <value>
               <tuple>
-                <string>trade_date/trade_phase/vifib/delivery</string>
                 <string>trade_phase/vifib/invoicing</string>
               </tuple>
             </value>
diff --git a/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/order_path.xml b/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/order_path.xml
index abcdd12c73e681892a606dc3f0f628c7057ff157..7682fa6b7151e0e9ca0646b7074df1241574a1cf 100644
--- a/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/order_path.xml
+++ b/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/order_path.xml
@@ -50,7 +50,6 @@
             <value>
               <tuple>
                 <string>trade_phase/vifib/order</string>
-                <string>trade_date/trade_phase/vifib/order</string>
               </tuple>
             </value>
         </item>
diff --git a/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/payment_credit_path.xml b/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/payment_credit_path.xml
index 8b0903a269fa369873a3c49a34615a15fe61cb6b..6c02c04380a2642e17a0cfc2efdc0520b281f0bf 100644
--- a/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/payment_credit_path.xml
+++ b/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/payment_credit_path.xml
@@ -52,7 +52,6 @@
                 <string>trade_phase/vifib/payment</string>
                 <string>source/account_module/receivable</string>
                 <string>destination/account_module/payable</string>
-                <string>trade_date/trade_phase/vifib/invoicing</string>
               </tuple>
             </value>
         </item>
diff --git a/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/payment_debit_path.xml b/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/payment_debit_path.xml
index a8b8ad7208439f481f526fb7a7c5dc88a052e33e..74b047a22f6dc06ef9dc9e88262a4ad71f59b7ab 100644
--- a/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/payment_debit_path.xml
+++ b/master/bt5/vifib_data_simulation/PathTemplateItem/business_process_module/vifib_sale_business_process/payment_debit_path.xml
@@ -52,7 +52,6 @@
                 <string>trade_phase/vifib/payment</string>
                 <string>source/account_module/bank</string>
                 <string>destination/account_module/bank</string>
-                <string>trade_date/trade_phase/vifib/invoicing</string>
                 <string>source_payment/organisation_module/vifib_internet/bank_account</string>
               </tuple>
             </value>
diff --git a/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/category_movement_group_on_delivery.xml b/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/category_movement_group_on_delivery.xml
index 32380a8d729b6366ed37bb4709e1b749f186d070..302a013b8eea6711e67543b5630d21815f4ca9ea 100644
--- a/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/category_movement_group_on_delivery.xml
+++ b/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/category_movement_group_on_delivery.xml
@@ -37,21 +37,12 @@
             <key> <string>tested_property</string> </key>
             <value>
               <tuple>
-                <string>specialise</string>
                 <string>delivery_mode</string>
                 <string>incoterm</string>
                 <string>source</string>
                 <string>destination</string>
                 <string>source_section</string>
                 <string>destination_section</string>
-                <string>source_decision</string>
-                <string>destination_decision</string>
-                <string>source_administration</string>
-                <string>destination_administration</string>
-                <string>source_project</string>
-                <string>destination_project</string>
-                <string>source_payment</string>
-                <string>destination_payment</string>
                 <string>price_currency</string>
               </tuple>
             </value>
diff --git a/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/category_movement_group_on_line.xml b/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/category_movement_group_on_line.xml
index c8cb87018c6bb19aff5b63231c07a720c6098646..5c6e19eec86e185759d8ece3e961572a7512efa0 100644
--- a/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/category_movement_group_on_line.xml
+++ b/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/category_movement_group_on_line.xml
@@ -37,6 +37,7 @@
             <key> <string>tested_property</string> </key>
             <value>
               <tuple>
+                <string>specialise</string>
                 <string>resource</string>
                 <string>aggregate</string>
                 <string>quantity_unit</string>
@@ -46,6 +47,14 @@
                 <string>destination_function</string>
                 <string>source_account</string>
                 <string>destination_account</string>
+                <string>source_decision</string>
+                <string>destination_decision</string>
+                <string>source_administration</string>
+                <string>destination_administration</string>
+                <string>source_project</string>
+                <string>destination_project</string>
+                <string>source_payment</string>
+                <string>destination_payment</string>
               </tuple>
             </value>
         </item>
diff --git a/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/causality_movement_group_on_delivery.xml b/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/causality_movement_group_on_delivery.xml
deleted file mode 100644
index c21b216321908a7119acf376d9d74aa5bca3b043..0000000000000000000000000000000000000000
--- a/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/causality_movement_group_on_delivery.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="Causality Movement Group" module="erp5.portal_type"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>categories</string> </key>
-            <value>
-              <tuple>
-                <string>collect_order_group/delivery</string>
-              </tuple>
-            </value>
-        </item>
-        <item>
-            <key> <string>description</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>causality_movement_group_on_delivery</string> </value>
-        </item>
-        <item>
-            <key> <string>int_index</string> </key>
-            <value> <int>3</int> </value>
-        </item>
-        <item>
-            <key> <string>portal_type</string> </key>
-            <value> <string>Causality Movement Group</string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string>causality_movement_group_on_delivery</string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/delivery_causality_assignement_movement_group_on_delivery.xml b/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/delivery_causality_assignement_movement_group_on_line.xml
similarity index 84%
rename from master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/delivery_causality_assignement_movement_group_on_delivery.xml
rename to master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/delivery_causality_assignement_movement_group_on_line.xml
index 2b93245cbc5740c5165f762cabbbb0eb857bf0be..42261dffcafc02acd693cd1a003649612d129a1d 100644
--- a/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/delivery_causality_assignement_movement_group_on_delivery.xml
+++ b/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/delivery_causality_assignement_movement_group_on_line.xml
@@ -10,7 +10,7 @@
             <key> <string>categories</string> </key>
             <value>
               <tuple>
-                <string>collect_order_group/delivery</string>
+                <string>collect_order_group/line</string>
               </tuple>
             </value>
         </item>
@@ -22,7 +22,7 @@
         </item>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>delivery_causality_assignement_movement_group_on_delivery</string> </value>
+            <value> <string>delivery_causality_assignement_movement_group_on_line</string> </value>
         </item>
         <item>
             <key> <string>int_index</string> </key>
@@ -34,7 +34,7 @@
         </item>
         <item>
             <key> <string>title</string> </key>
-            <value> <string>Delivery Causality Assignement Movement Group On Delivery</string> </value>
+            <value> <string>delivery_causality_assignement_movement_group_on_line</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/property_movement_group_on_delivery.xml b/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/property_movement_group_on_delivery.xml
deleted file mode 100644
index 49a31d06eb4c5b867cf5828dd458ff54b772a578..0000000000000000000000000000000000000000
--- a/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/property_movement_group_on_delivery.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="Property Movement Group" module="erp5.portal_type"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>categories</string> </key>
-            <value>
-              <tuple>
-                <string>divergence_scope/property</string>
-                <string>collect_order_group/delivery</string>
-              </tuple>
-            </value>
-        </item>
-        <item>
-            <key> <string>description</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>property_movement_group_on_delivery</string> </value>
-        </item>
-        <item>
-            <key> <string>int_index</string> </key>
-            <value> <int>1</int> </value>
-        </item>
-        <item>
-            <key> <string>portal_type</string> </key>
-            <value> <string>Property Movement Group</string> </value>
-        </item>
-        <item>
-            <key> <string>tested_property</string> </key>
-            <value>
-              <tuple>
-                <string>start_date</string>
-                <string>stop_date</string>
-              </tuple>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string>property_movement_group_on_delivery</string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/property_movement_group_on_line.xml b/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/property_movement_group_on_line.xml
index 885ac3a97ace12ea37c40e8ae949ea35eff66b00..a7c5c38fe2b30090c7898a632cf7858f724e2266 100644
--- a/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/property_movement_group_on_line.xml
+++ b/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_builder/property_movement_group_on_line.xml
@@ -38,6 +38,8 @@
             <value>
               <tuple>
                 <string>description</string>
+                <string>start_date</string>
+                <string>stop_date</string>
               </tuple>
             </value>
         </item>
@@ -47,6 +49,10 @@
               <none/>
             </value>
         </item>
+        <item>
+            <key> <string>update_always</string> </key>
+            <value> <int>0</int> </value>
+        </item>
       </dictionary>
     </pickle>
   </record>
diff --git a/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_transaction_builder/property_movement_group_on_delivery.xml b/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_transaction_builder/property_movement_group_on_delivery.xml
deleted file mode 100644
index 6436fb8009629d30dc9893cdcc1b0c9221156277..0000000000000000000000000000000000000000
--- a/master/bt5/vifib_data_simulation/PathTemplateItem/portal_deliveries/vifib_sale_invoice_transaction_builder/property_movement_group_on_delivery.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="Property Movement Group" module="erp5.portal_type"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>categories</string> </key>
-            <value>
-              <tuple>
-                <string>divergence_scope/property</string>
-                <string>collect_order_group/delivery</string>
-              </tuple>
-            </value>
-        </item>
-        <item>
-            <key> <string>description</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>property_movement_group_on_delivery</string> </value>
-        </item>
-        <item>
-            <key> <string>int_index</string> </key>
-            <value> <int>2</int> </value>
-        </item>
-        <item>
-            <key> <string>portal_type</string> </key>
-            <value> <string>Property Movement Group</string> </value>
-        </item>
-        <item>
-            <key> <string>tested_property</string> </key>
-            <value>
-              <tuple>
-                <string>start_date</string>
-                <string>stop_date</string>
-              </tuple>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string>property_movement_group_on_delivery</string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/master/bt5/vifib_data_simulation/bt/revision b/master/bt5/vifib_data_simulation/bt/revision
index 4b6f9c39e5c757bf387d465c53026b336dd8b96c..9cd72aa941214d4cb8522dda34eb12cf878e3e8b 100644
--- a/master/bt5/vifib_data_simulation/bt/revision
+++ b/master/bt5/vifib_data_simulation/bt/revision
@@ -1 +1 @@
-64
\ No newline at end of file
+72
\ No newline at end of file
diff --git a/master/bt5/vifib_data_simulation/bt/template_keep_path_list b/master/bt5/vifib_data_simulation/bt/template_keep_path_list
deleted file mode 100644
index 8f223d382139250cf9615de1ef1b1e6491157a26..0000000000000000000000000000000000000000
--- a/master/bt5/vifib_data_simulation/bt/template_keep_path_list
+++ /dev/null
@@ -1,27 +0,0 @@
-account_module/bank
-account_module/capital
-account_module/coll_vat
-account_module/equipments
-account_module/inventories
-account_module/payable
-account_module/profit_loss
-account_module/purchase
-account_module/receivable
-account_module/refundable_vat
-account_module/sales
-portal_rules/new_invoice_simulation_rule
-portal_rules/new_invoice_simulation_rule/**
-portal_rules/new_delivery_simulation_rule
-portal_rules/new_delivery_simulation_rule/**
-portal_rules/new_delivery_root_simulation_rule
-portal_rules/new_delivery_root_simulation_rule/**
-portal_rules/new_invoice_transaction_simulation_rule
-portal_rules/new_invoice_transaction_simulation_rule/**
-portal_rules/new_invoice_root_simulation_rule
-portal_rules/new_invoice_root_simulation_rule/**
-portal_rules/new_order_root_simulation_rule
-portal_rules/new_order_root_simulation_rule/**
-portal_rules/default_subscription_item_rule
-portal_rules/default_subscription_item_rule/**
-portal_rules/new_payment_simulation_rule
-portal_rules/new_payment_simulation_rule/**
\ No newline at end of file
diff --git a/master/bt5/vifib_erp5/ExtensionTemplateItem/VifibSecurity.py b/master/bt5/vifib_erp5/ExtensionTemplateItem/VifibSecurity.py
index 5691378a3f6a990d7f478743a0c242aa31b48360..ac4cb3b2c1dba671f197d0a5fc4071199f282aa5 100644
--- a/master/bt5/vifib_erp5/ExtensionTemplateItem/VifibSecurity.py
+++ b/master/bt5/vifib_erp5/ExtensionTemplateItem/VifibSecurity.py
@@ -1,4 +1,4 @@
-##############################################################################
+###############################################################################
 #
 # Copyright (c) 2002-2011 Nexedi SA and Contributors. All Rights Reserved.
 #
@@ -86,7 +86,6 @@ def SoftwareInstance_requestDestroySlaveInstanceRelated(self):
   computer_partition_relative_url = self.getAggregateRelatedValue(
     "Sale Packing List Line").getAggregate(portal_type="Computer Partition")
   portal_preferences = portal.portal_preferences
-  simulation_state = ["started", "confirmed"]
   service_uid_list = [
     portal.restrictedTraverse(portal_preferences.getPreferredInstanceHostingResource()).getUid(),
     portal.restrictedTraverse(portal_preferences.getPreferredInstanceSetupResource()).getUid(),
@@ -95,10 +94,13 @@ def SoftwareInstance_requestDestroySlaveInstanceRelated(self):
     result_list = self.portal_catalog(portal_type="Sale Packing List Line",
        aggregate_portal_type="Slave Instance",
        computer_partition_relative_url=computer_partition_relative_url,
-       simulation_state=simulation_state,
        default_resource_uid=service_uid_list)
     slave_instance_list = [line.getAggregateValue(portal_type="Slave Instance") for line in result_list]
+    uid_list = []
     for slave_instance in slave_instance_list:
+      slave_instance_uid = slave_instance.getUid()
+      if slave_instance_uid in uid_list:
+        continue
       cleanup_packing_list = self.portal_catalog(
          portal_type='Sale Packing List Line',
          aggregate_relative_url=slave_instance.getRelativeUrl(),
@@ -106,6 +108,7 @@ def SoftwareInstance_requestDestroySlaveInstanceRelated(self):
          limit=1,
       )
       if len(cleanup_packing_list) == 0:
+        uid_list.append(slave_instance_uid)
         slave_instance.requestDestroyComputerPartition()
   finally:
     # Restore the original user.
diff --git a/master/bt5/vifib_slap/ActionTemplateItem/portal_types/Computer%20Partition/jump_to_related_usage_report_list.xml b/master/bt5/vifib_slap/ActionTemplateItem/portal_types/Computer%20Partition/jump_to_related_usage_report_list.xml
deleted file mode 100644
index c9845434aa04f03e7d2637835fe35ac096ec5f76..0000000000000000000000000000000000000000
--- a/master/bt5/vifib_slap/ActionTemplateItem/portal_types/Computer%20Partition/jump_to_related_usage_report_list.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>action</string> </key>
-            <value>
-              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
-            </value>
-        </item>
-        <item>
-            <key> <string>categories</string> </key>
-            <value>
-              <tuple>
-                <string>action_type/object_jump</string>
-              </tuple>
-            </value>
-        </item>
-        <item>
-            <key> <string>category</string> </key>
-            <value> <string>object_jump</string> </value>
-        </item>
-        <item>
-            <key> <string>condition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>description</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>icon</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>jump_to_related_usage_report_list</string> </value>
-        </item>
-        <item>
-            <key> <string>permissions</string> </key>
-            <value>
-              <tuple>
-                <string>View</string>
-              </tuple>
-            </value>
-        </item>
-        <item>
-            <key> <string>portal_type</string> </key>
-            <value> <string>Action Information</string> </value>
-        </item>
-        <item>
-            <key> <string>priority</string> </key>
-            <value> <float>1.0</float> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string>Related Usage Reports</string> </value>
-        </item>
-        <item>
-            <key> <string>visible</string> </key>
-            <value> <int>1</int> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-  <record id="2" aka="AAAAAAAAAAI=">
-    <pickle>
-      <global name="Expression" module="Products.CMFCore.Expression"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>text</string> </key>
-            <value> <string encoding="cdata"><![CDATA[
-
-string:${object_url}/Base_jumpToRelatedObject?base_category=causality&portal_type=Usage+Report
-
-]]></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/master/bt5/vifib_slap/ActionTemplateItem/portal_types/Virtio%20Partition/jump_to_related_usage_report_list.xml b/master/bt5/vifib_slap/ActionTemplateItem/portal_types/Virtio%20Partition/jump_to_related_usage_report_list.xml
deleted file mode 100644
index c9845434aa04f03e7d2637835fe35ac096ec5f76..0000000000000000000000000000000000000000
--- a/master/bt5/vifib_slap/ActionTemplateItem/portal_types/Virtio%20Partition/jump_to_related_usage_report_list.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>action</string> </key>
-            <value>
-              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
-            </value>
-        </item>
-        <item>
-            <key> <string>categories</string> </key>
-            <value>
-              <tuple>
-                <string>action_type/object_jump</string>
-              </tuple>
-            </value>
-        </item>
-        <item>
-            <key> <string>category</string> </key>
-            <value> <string>object_jump</string> </value>
-        </item>
-        <item>
-            <key> <string>condition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>description</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>icon</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>jump_to_related_usage_report_list</string> </value>
-        </item>
-        <item>
-            <key> <string>permissions</string> </key>
-            <value>
-              <tuple>
-                <string>View</string>
-              </tuple>
-            </value>
-        </item>
-        <item>
-            <key> <string>portal_type</string> </key>
-            <value> <string>Action Information</string> </value>
-        </item>
-        <item>
-            <key> <string>priority</string> </key>
-            <value> <float>1.0</float> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string>Related Usage Reports</string> </value>
-        </item>
-        <item>
-            <key> <string>visible</string> </key>
-            <value> <int>1</int> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-  <record id="2" aka="AAAAAAAAAAI=">
-    <pickle>
-      <global name="Expression" module="Products.CMFCore.Expression"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>text</string> </key>
-            <value> <string encoding="cdata"><![CDATA[
-
-string:${object_url}/Base_jumpToRelatedObject?base_category=causality&portal_type=Usage+Report
-
-]]></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_buildVifibPath.xml b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_buildVifibPath.xml
index 8bcdcd3fccb9ede49567b71c7f121e050efbf841..5e9d1dbd8fc98103475e82e73c7de6cc9bb893e1 100644
--- a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_buildVifibPath.xml
+++ b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_buildVifibPath.xml
@@ -51,19 +51,11 @@
         <item>
             <key> <string>_body</string> </key>
             <value> <string>portal = context.getPortalObject()\n
-\n
-build_before = None\n
-if params is not None:\n
-  build_before = params.get(\'build_before\', None)\n
-  kw = {\'build_before\':build_before}\n
-else:\n
-  kw = {}\n
-\n
 for business_process in [\n
   portal.business_process_module.vifib_sale_business_process,\n
   portal.business_process_module.vifib_purchase_business_process]:\n
   for link in business_process.contentValues(portal_type="Business Link"):\n
-    link.build(**kw)\n
+    link.build()\n
 </string> </value>
         </item>
         <item>
diff --git a/master/bt5/vifib_slap/bt/revision b/master/bt5/vifib_slap/bt/revision
index e1170b6414efa1bb63c186ec4a9b5391653f5fa2..560731b56bf1c51dd98fee4303136e403d943dab 100644
--- a/master/bt5/vifib_slap/bt/revision
+++ b/master/bt5/vifib_slap/bt/revision
@@ -1 +1 @@
-489
\ No newline at end of file
+490
\ No newline at end of file
diff --git a/master/bt5/vifib_slap/bt/template_action_path_list b/master/bt5/vifib_slap/bt/template_action_path_list
index f986e641c09c6ef806d3dfaef20510e75731a8e5..b0421cc2e23708c9b49fb265aafbc9bdadf517b8 100644
--- a/master/bt5/vifib_slap/bt/template_action_path_list
+++ b/master/bt5/vifib_slap/bt/template_action_path_list
@@ -1,4 +1,2 @@
-Computer Partition | jump_to_related_usage_report_list
 System Preference | vifib_preference
-Virtio Partition | jump_to_related_usage_report_list
 Virtio Partition | view
\ No newline at end of file
diff --git a/master/product/Vifib/tests/testVifibInstanceHostingRelatedDocument.py b/master/product/Vifib/tests/testVifibInstanceHostingRelatedDocument.py
index 3de3519964a5bc8ddb0a33acded2b89c4a683648..ead0ee53d1124642fa222d2421a204c73324f8f3 100644
--- a/master/product/Vifib/tests/testVifibInstanceHostingRelatedDocument.py
+++ b/master/product/Vifib/tests/testVifibInstanceHostingRelatedDocument.py
@@ -1,143 +1,283 @@
 import unittest
 from Products.ERP5Type.tests.Sequence import SequenceList
-from Products.ERP5Type.DateUtils import getClosestDate, addToDate
 from testVifibSlapWebService import TestVifibSlapWebServiceMixin
-
-from DateTime.DateTime import DateTime
+from Products.ERP5Type.DateUtils import getClosestDate
+from DateTime import DateTime
+from testVifibOpenOrderSimulation import generateTimeFrameList
 
 class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
 
-  def stepTriggerNextBuild(self, sequence, **kw):
-    build_before = sequence.get('build_before')
-    if build_before is None:
-      build_before = getClosestDate(
-        target_date=DateTime(), precision='month', before=0)
-      self.portal.portal_alarms.vifib_trigger_build.activeSense()
-    else:
-      build_before = addToDate(build_before, month=1)
-      self.portal.portal_alarms.vifib_trigger_build.activeSense(
-        params={'build_before':build_before})
-    sequence.edit(
-      number_of_sale_packing_list=sequence.get(
-        'number_of_sale_packing_list', 0) + 1,
-      invoice_amount=sequence.get('invoice_amount', 0) + 1,
-      payment_amount=sequence.get('payment_amount', 0) + 1,
-      build_before=build_before
-    )
+  def stepTriggerBuild(self, sequence, **kw):
+    self.portal.portal_alarms.vifib_trigger_build.activeSense()
 
-  def stepCheckOneMoreDocumentList(self, sequence, **kw):
-    hosting_subscription = self.portal.portal_catalog\
-      .getResultValue(uid=sequence['hosting_subscription_uid'])
-    sale_packing_list_list = self.portal.portal_catalog(
+  def stepCheckPayment(self, sequence, **kw):
+    raise NotImplementedError
+
+  def stepCheckSubscriptionSalePackingListCoverage(self, sequence, **kw):
+    hosting_subscription = self.portal.portal_catalog.getResultValue(
+      uid=sequence['hosting_subscription_uid'])
+    delivery_list = self.portal.portal_catalog(
       portal_type='Sale Packing List',
       causality_relative_url=hosting_subscription.getRelativeUrl(),
-      sort_on=(('delivery.start_date', "DESC")))
+      sort_on=(('delivery.start_date', 'desc'),)
+    )
+    # is whole year covered?
+    self.assertEqual(12, len(delivery_list))
+
+    # generate the expected time frames
+    now = DateTime()
+    start_date = \
+      getClosestDate(target_date=now, precision='day', before=1)
 
-    self.assertEqual(sequence['number_of_sale_packing_list'],
-      len(sale_packing_list_list))
+    # Calculate the list of time frames
+    expected_time_frame_list = generateTimeFrameList(start_date)
 
-    sale_packing_list = sale_packing_list_list[0].getObject()
-    sale_invoice_transaction_list = sale_packing_list\
-      .getCausalityRelatedValueList(portal_type='Sale Invoice Transaction')
-    self.assertEqual(sequence['invoice_amount'], len(sale_invoice_transaction_list))
-    sale_invoice_transaction = sale_invoice_transaction_list[0]
+    idx = 0
+    for delivery in delivery_list:
+      expected_start_date = expected_time_frame_list[idx]
+      expected_stop_date = expected_time_frame_list[idx+1]
+      self.assertEqual(expected_start_date, delivery.getStartDate())
+      self.assertEqual(expected_stop_date, delivery.getStopDate())
 
-    payment_transaction_list = sale_invoice_transaction\
-      .getCausalityRelatedValueList(portal_type='Payment Transaction')
-    self.assertEqual(1, len(payment_transaction_list))
-    payment_transaction = payment_transaction_list[0]
+      self.assertEqual(hosting_subscription.getRelativeUrl(),
+        delivery.getCausality())
+      delivery_line_list = \
+        delivery.contentValues(portal_type="Sale Packing List Line")
+      self.assertEquals(1, len(delivery_line_list))
+      delivery_line = delivery_line_list[0]
+      self.assertEquals("organisation_module/vifib_internet",
+        delivery.getSource())
+      self.assertEquals("organisation_module/vifib_internet",
+        delivery.getSourceSection())
+      self.assertEquals("person_module/test_vifib_customer",
+        delivery.getDestination())
+      self.assertEquals("person_module/test_vifib_customer",
+        delivery.getDestinationSection())
+      self.assertEquals("currency_module/EUR",
+        delivery.getPriceCurrency())
 
+      # check sale packing list line related property
+      self.assertEquals("service_module/vifib_instance_subscription",
+        delivery_line.getResource())
+      self.assertEquals(1,
+        delivery_line.getQuantity())
+      self.assertEquals("unit/piece",
+        delivery_line.getQuantityUnit())
+      self.assertEquals(1,
+        delivery_line.getPrice())
+
+      # fetch open order, open order line and subscription
+      person = self.portal.person_module['test_vifib_customer']
+      open_order = \
+        person.getDestinationDecisionRelatedValue(portal_type="Open Sale Order")
+      open_order_line = \
+        open_order.contentValues(portal_type="Open Sale Order Line")[0]
+
+      # check related property
+      self.assertEquals(open_order_line.getSpecialise(),
+        delivery.getSpecialise())
+
+      idx += 1
+
+  def stepCheckHostingSubscriptionInitialDocumentCoverage(self, sequence, **kw):
+    catalog = self.portal.portal_catalog
+    hosting_resource = self.portal.portal_preferences\
+      .getPreferredInstanceHostingResource()
+    setup_resource = self.portal.portal_preferences\
+      .getPreferredInstanceSetupResource()
+    subscription_resource = self.portal.portal_preferences\
+      .getPreferredInstanceSubscriptionResource()
     sequence.edit(
-      current_sale_packing_list=sale_packing_list,
-      current_sale_invoice_transaction=sale_invoice_transaction,
-      current_payment_transaction=payment_transaction
+      hosting_resource=hosting_resource,
+      setup_resource=setup_resource,
+      subscription_resource=subscription_resource
     )
 
-  def stepCheckSalePackingList(self, sequence, **kw):
-    # check one more sale packing list is generated
-    # and only one sale packing list line is inside
-    sale_packing_list = sequence['current_sale_packing_list']
-    sale_packing_list_line_list = \
-      sale_packing_list.contentValues(portal_type="Sale Packing List Line")
-    self.assertEquals(1, len(sale_packing_list_line_list))
-    sale_packing_list_line = sale_packing_list_line_list[0]
-
-    # check sale packing list related property
-    self.assertEquals("organisation_module/vifib_internet",
-      sale_packing_list.getSource())
-    self.assertEquals("organisation_module/vifib_internet",
-      sale_packing_list.getSourceSection())
-    self.assertEquals("person_module/test_vifib_customer",
-      sale_packing_list.getDestination())
-    self.assertEquals("person_module/test_vifib_customer",
-      sale_packing_list.getDestinationSection())
-    self.assertEquals("currency_module/EUR",
-      sale_packing_list.getPriceCurrency())
-
-    # check sale packing list line related property
-    self.assertEquals("service_module/vifib_instance_subscription",
-      sale_packing_list_line.getResource())
-    self.assertEquals(1,
-      sale_packing_list_line.getQuantity())
-    self.assertEquals("unit/piece",
-      sale_packing_list_line.getQuantityUnit())
-    self.assertEquals(1,
-      sale_packing_list_line.getPrice())
-
-    # fetch open order, open order line and subscription
-    person = self.portal.person_module['test_vifib_customer']
-    open_order = \
-      person.getDestinationDecisionRelatedValue(portal_type="Open Sale Order")
-    open_order_line = \
-      open_order.contentValues(portal_type="Open Sale Order Line")[0]
-
-    # check related property
-    self.assertEquals(open_order_line.getSpecialise(),
-      sale_packing_list.getSpecialise())
-
-  def stepCheckInvoiceAndInvoiceTransaction(self, sequence, **kw):
-    sale_invoice_transaction = sequence['current_sale_invoice_transaction']
-    self.assertEqual(sale_invoice_transaction.getSimulationState(),
-      'confirmed')
-    self.assertEqual(sale_invoice_transaction.getCausalityList(),
-      [sequence['current_sale_packing_list'].getRelativeUrl()])
-    self.portal.portal_workflow.doActionFor(sale_invoice_transaction,
-      'start_action')
-    self.assertEqual(sale_invoice_transaction.getSimulationState(),
-      'started')
+    hosting_subscription = catalog.getResultValue(
+      uid=sequence['hosting_subscription_uid'])
+    hosting_subscription_url = hosting_subscription.getRelativeUrl()
+
+    # hosting is confirmed, so no invoice
+    hosting_delivery_line_list = catalog(portal_type='Sale Packing List Line',
+      aggregate_relative_url=hosting_subscription_url,
+      resource_relative_url=hosting_resource)
+
+    self.assertEqual(1, len(hosting_delivery_line_list))
+    self.assertEqual('confirmed', hosting_delivery_line_list[0]\
+      .getSimulationState())
+
+    hosting_invoice_line_list = catalog(portal_type='Invoice Line',
+      aggregate_relative_url=hosting_subscription_url,
+      resource_relative_url=hosting_resource)
+    self.assertEqual(0, len(hosting_invoice_line_list))
+
+    # setup is stopped, and has there is invoice
+    setup_delivery_line_list = catalog(portal_type='Sale Packing List Line',
+      aggregate_relative_url=hosting_subscription_url,
+      resource_relative_url=setup_resource)
+
+    self.assertEqual(1, len(setup_delivery_line_list))
+    self.assertEqual('stopped', setup_delivery_line_list[0]\
+      .getSimulationState())
+
+    setup_invoice_line_list = catalog(portal_type='Invoice Line',
+      aggregate_relative_url=hosting_subscription_url,
+      resource_relative_url=setup_resource)
+    self.assertEqual(1, len(setup_invoice_line_list))
+    self.assertEqual('planned', setup_invoice_line_list[0]\
+      .getSimulationState())
+
+    # there are 12 confirmed subscription, so no invoice
+    subscription_delivery_line_list = catalog(
+      portal_type='Sale Packing List Line',
+      aggregate_relative_url=hosting_subscription_url,
+      resource_relative_url=subscription_resource,
+      sort_on=(('movement.start_date', 'desc'),)
+    )
+
+    self.assertEqual(12, len(subscription_delivery_line_list))
+    self.assertEqual(['confirmed'] * 12, [q.getSimulationState() for \
+      q in subscription_delivery_line_list])
+
+    subscription_invoice_line_list = catalog(portal_type='Invoice Line',
+      aggregate_relative_url=hosting_subscription_url,
+      resource_relative_url=subscription_resource)
+    self.assertEqual(0, len(subscription_invoice_line_list))
+
+    # invoice shall be solved
+    self.assertEqual('solved', setup_invoice_line_list[0].getCausalityState())
+
+    # invoice shall have causality of one packing list
+    self.assertEqual(
+      [setup_delivery_line_list[0].getParentValue().getUid()],
+      setup_invoice_line_list[0].getParentValue().getCausalityUidList())
+
+    sequence.edit(
+      subscription_delivery_uid_list=[q.getParentValue().getUid() for q in \
+        subscription_delivery_line_list]
+    )
+
+  def stepSelectNextSubscriptionDelivery(self, sequence, **kw):
+    subscription_delivery_uid_list = sequence['subscription_delivery_uid_list']
+    subscription_delivery_uid_list.reverse()
+    subscription_delivery_uid = subscription_delivery_uid_list.pop()
+    subscription_delivery_uid_list.reverse()
+    sequence.edit(
+      subscription_delivery_uid_list=subscription_delivery_uid_list,
+      subscription_delivery_uid=subscription_delivery_uid
+    )
+
+  def stepStartSubscriptionDelivery(self, sequence, **kw):
+    self.portal.portal_catalog.getResultValue(
+      uid=sequence['subscription_delivery_uid']).start()
+
+  def stepStopSubscriptionDelivery(self, sequence, **kw):
+    self.portal.portal_catalog.getResultValue(
+      uid=sequence['subscription_delivery_uid']).stop()
+
+  def stepCheckHostingSubscriptionStoppedDocumentCoverage(self, sequence, **kw):
+    catalog = self.portal.portal_catalog
+    hosting_subscription = catalog.getResultValue(
+      uid=sequence['hosting_subscription_uid'])
+    hosting_subscription_url = hosting_subscription.getRelativeUrl()
+
+    # hosting is confirmed, so no invoice
+    hosting_delivery_line_list = catalog(portal_type='Sale Packing List Line',
+      aggregate_relative_url=hosting_subscription_url,
+      resource_relative_url=sequence['hosting_resource'])
+
+    self.assertEqual(1, len(hosting_delivery_line_list))
+    self.assertEqual('confirmed', hosting_delivery_line_list[0]\
+      .getSimulationState())
+
+    hosting_invoice_line_list = catalog(portal_type='Invoice Line',
+      aggregate_relative_url=hosting_subscription_url,
+      resource_relative_url=sequence['hosting_resource'])
+    self.assertEqual(0, len(hosting_invoice_line_list))
+
+    # setup is stopped, and has there is invoice
+    setup_delivery_line_list = catalog(portal_type='Sale Packing List Line',
+      aggregate_relative_url=hosting_subscription_url,
+      resource_relative_url=sequence['setup_resource'])
+
+    self.assertEqual(1, len(setup_delivery_line_list))
+    self.assertEqual('stopped', setup_delivery_line_list[0]\
+      .getSimulationState())
+
+    setup_invoice_line_list = catalog(portal_type='Invoice Line',
+      aggregate_relative_url=hosting_subscription_url,
+      resource_relative_url=sequence['setup_resource'])
+    self.assertEqual(1, len(setup_invoice_line_list))
+    self.assertEqual('planned', setup_invoice_line_list[0]\
+      .getSimulationState())
+
+    # there are 11 confirmed and 1 stopped subscription, so 1 invoice line
+    subscription_delivery_line_list = catalog(
+      portal_type='Sale Packing List Line',
+      aggregate_relative_url=hosting_subscription_url,
+      resource_relative_url=sequence['subscription_resource'])
+
+    self.assertEqual(12, len(subscription_delivery_line_list))
+    self.assertEqual((['confirmed'] * 11) + ['stopped'],
+      sorted([q.getSimulationState() for \
+      q in subscription_delivery_line_list]))
+
+    subscription_invoice_line_list = catalog(portal_type='Invoice Line',
+      aggregate_relative_url=hosting_subscription_url,
+      resource_relative_url=sequence['subscription_resource'])
+    self.assertEqual(1, len(subscription_invoice_line_list))
+    self.assertEqual('planned', subscription_invoice_line_list[0]\
+      .getSimulationState())
+
+    # there are two invoice lines sharing same invoice
+    self.assertEqual(
+      setup_invoice_line_list[0].getParentValue().getRelativeUrl(),
+      subscription_invoice_line_list[0].getParentValue().getRelativeUrl()
+    )
+
+    # invoice shall be solved
+    self.assertEqual('solved', setup_invoice_line_list[0].getCausalityState())
+
+    # invoice shall have causality of two packing lists
+    self.assertEqual(
+      sorted([setup_delivery_line_list[0].getParentValue().getUid()] +
+      [q.getParentValue().getUid() for q in subscription_delivery_line_list if q.getSimulationState() == 'stopped']),
+      sorted(setup_invoice_line_list[0].getParentValue().getCausalityUidList()))
 
-  def stepCheckPayment(self, sequence, **kw):
-    payment_transaction = sequence['current_payment_transaction']
-    self.assertEqual(payment_transaction.getSimulationState(), 'planned')
-    self.assertEqual(payment_transaction.getCausalityList(),
-      [sequence['current_sale_invoice_transaction'].getRelativeUrl()])
-    self.portal.portal_workflow.doActionFor(payment_transaction,
-      'confirm_action')
-    self.assertEqual(payment_transaction.getSimulationState(),
-      'confirmed')
 
   def test_OpenOrder_sale_packing_list(self):
     """
     Check that sale_packing_list is generated properly from simulation
     """
-    check_one_month = """
-      LoginDefaultUser
-      TriggerNextBuild
-      Tic
-      Logout
-
-      LoginDefaultUser
-      CheckOneMoreDocumentList
-      CheckSalePackingList
-      CheckInvoiceAndInvoiceTransaction
-      CheckPayment
-      Logout
-    """
-    self.computer_partition_amount = 1
     sequence_list = SequenceList()
     sequence_string = \
-        self.prepare_installed_computer_partition_sequence_string \
-          + (check_one_month * 12)
+        self.prepare_installed_computer_partition_sequence_string  + \
+        """
+        LoginDefaultUser
+        TriggerBuild
+        Tic
+        CheckSubscriptionSalePackingListCoverage
+
+        TriggerBuild
+        Tic
+        # Nothing shall change
+        CheckHostingSubscriptionInitialDocumentCoverage
+
+        # Stop first Subscriptoin delivery and after triggering build check
+        # that invoice got updated
+
+        SelectNextSubscriptionDelivery
+        StartSubscriptionDelivery
+        StopSubscriptionDelivery
+        Tic
+
+        TriggerBuild
+        Tic
+
+        CheckHostingSubscriptionStoppedDocumentCoverage
+
+        CheckPayment
+        """
     sequence_list.addSequenceString(sequence_string)
     sequence_list.play(self)
 
diff --git a/master/product/Vifib/tests/testVifibOpenOrderSimulation.py b/master/product/Vifib/tests/testVifibOpenOrderSimulation.py
index f5e762ddbdea4bd2fe0f99e13f5cb39c0929975c..eb547740397b22dfb15f7588f9d0114ef326fa5e 100644
--- a/master/product/Vifib/tests/testVifibOpenOrderSimulation.py
+++ b/master/product/Vifib/tests/testVifibOpenOrderSimulation.py
@@ -5,6 +5,14 @@ from testVifibSlapWebService import TestVifibSlapWebServiceMixin
 
 from DateTime.DateTime import DateTime
 
+def generateTimeFrameList(start_date):
+  expected_time_frame_list = [start_date]
+  current = \
+    getClosestDate(target_date=start_date, precision='month', before=0)
+  for m in range(0, 12):
+    expected_time_frame_list.append(addToDate(current, month=m))
+  return expected_time_frame_list
+
 class TestVifibOpenOrderSimulation(TestVifibSlapWebServiceMixin):
 
   def stepCheckSimulationMovement(self, sequence, **kw):
@@ -76,37 +84,25 @@ class TestVifibOpenOrderSimulation(TestVifibSlapWebServiceMixin):
       0.0, open_order_line.getStopDate().second())
 
     # Calculate the list of time frames
-    expected_time_frame_list = [start_date]
-    current = \
-      getClosestDate(target_date=start_date, precision='month', before=0)
-    if start_date == current:
-      current = addToDate(start_date, month=1)
-    while current <= stop_date:
-      expected_time_frame_list.append(current)
-      current = addToDate(
-        getClosestDate(target_date=current, precision='month', before=0),
-        month=1)
+    expected_time_frame_list = generateTimeFrameList(start_date)
+
+    # test the test: have we generated 12th next months coverage?
+    self.assertEqual(13, len(expected_time_frame_list))
 
-    # Check that simulation is created by the periodicity
-    self.assertEquals(len(expected_time_frame_list),
-                      len(applied_rule.contentValues()) + 1)
+    simulation_movement_list = self.portal.portal_catalog(
+      portal_type='Simulation Movement',
+      parent_uid=applied_rule.getUid(),
+      sort_on=(('movement.start_date', 'desc'),)
+    )
+    # Check that simulation is created by the periodicity for one year
+    self.assertEquals(12,
+                      len(simulation_movement_list))
 
     # Check the list of expected simulation
     idx = 0
-    while idx + 1 < len(expected_time_frame_list):
-      # select simulation given start_date and stop_date
-      simulation_movement_list = \
-        self.portal.portal_catalog.unrestrictedSearchResults(
-          parent_uid=applied_rule.getUid(),
-          portal_type="Simulation Movement",
-          **{
-            'movement.start_date':expected_time_frame_list[idx],
-            'movement.stop_date':expected_time_frame_list[idx + 1],
-          })
-      self.assertEquals(1, len(simulation_movement_list))
-      simulation_movement = simulation_movement_list[0].getObject()
-      self.assertNotEquals(None, simulation_movement)
-
+    for simulation_movement in simulation_movement_list:
+      expected_start_date = expected_time_frame_list[idx]
+      expected_stop_date = expected_time_frame_list[idx+1]
       # Check simulation movement property
       self.assertEquals(1.0,
         simulation_movement.getQuantity())
@@ -144,6 +140,13 @@ class TestVifibOpenOrderSimulation(TestVifibSlapWebServiceMixin):
       self.assertEquals(None,
                            simulation_movement.getAggregate(
                              portal_type="Software Release"))
+      self.assertEqual(expected_start_date, simulation_movement.getStartDate())
+      self.assertEqual(expected_stop_date, simulation_movement.getStopDate())
+
+      # not delivered yet
+      self.assertEqual(None, simulation_movement.getDelivery())
+      # packing list shall be buildable
+      self.assertTrue(simulation_movement.isBuildable())
 
       # fetch invoice level simulation
       applied_rule_invoice_list = \
@@ -159,6 +162,11 @@ class TestVifibOpenOrderSimulation(TestVifibSlapWebServiceMixin):
         simulation_movement_invoice_list[0].getObject()
       self.assertNotEquals(None, simulation_movement_invoice)
 
+      # not delivered yet
+      self.assertEqual(None, simulation_movement_invoice.getDelivery())
+      # invoice shall be not yet buildable
+      self.assertFalse(False, simulation_movement_invoice.isBuildable())
+
       # check property of invoice simulation
       self.assertEquals(1.0,
         simulation_movement_invoice.getQuantity())
@@ -182,9 +190,9 @@ class TestVifibOpenOrderSimulation(TestVifibSlapWebServiceMixin):
         simulation_movement_invoice.getResource())
       self.assertEquals("vifib/invoicing",
         simulation_movement_invoice.getTradePhase())
-      self.assertEquals(expected_time_frame_list[idx+1],
+      self.assertEquals(expected_start_date,
         simulation_movement_invoice.getStartDate())
-      self.assertEquals(expected_time_frame_list[idx+1],
+      self.assertEquals(expected_stop_date,
         simulation_movement_invoice.getStopDate())
       self.assertEquals(None,
                         simulation_movement_invoice.getAggregate(
@@ -215,6 +223,10 @@ class TestVifibOpenOrderSimulation(TestVifibSlapWebServiceMixin):
       simulation_movement_invoice_transaction_debit = None
       for simulation_movement_invoice_transaction in \
         simulation_movement_invoice_transaction_list:
+        # not delivered nor buildable
+        self.assertEqual(None, simulation_movement_invoice_transaction\
+          .getDelivery())
+        self.assertFalse(simulation_movement_invoice_transaction.isBuildable())
         if "business_process_module/vifib_sale_business_process/account_credit_path" \
           in simulation_movement_invoice_transaction.getCausalityList():
             simulation_movement_invoice_transaction_credit = \
@@ -224,7 +236,17 @@ class TestVifibOpenOrderSimulation(TestVifibSlapWebServiceMixin):
             simulation_movement_invoice_transaction_debit = \
               simulation_movement_invoice_transaction.getObject()
       self.assertNotEquals(None, simulation_movement_invoice_transaction_credit)
+      # not delivered nor buildable
+      self.assertEqual(None, simulation_movement_invoice_transaction_credit\
+        .getDelivery())
+      self.assertFalse(simulation_movement_invoice_transaction_credit\
+        .isBuildable())
       self.assertNotEquals(None, simulation_movement_invoice_transaction_debit)
+      # not delivered nor buildable
+      self.assertEqual(None, simulation_movement_invoice_transaction_debit\
+        .getDelivery())
+      self.assertFalse(simulation_movement_invoice_transaction_debit\
+        .isBuildable())
 
       # check property of invoice transaction simulation
       self.assertEquals(-1.0,
@@ -249,9 +271,9 @@ class TestVifibOpenOrderSimulation(TestVifibSlapWebServiceMixin):
         simulation_movement_invoice_transaction_credit.getSpecialise())
       self.assertEquals("vifib/accounting",
         simulation_movement_invoice_transaction_credit.getTradePhase())
-      self.assertEquals(expected_time_frame_list[idx+1],
+      self.assertEquals(expected_start_date,
         simulation_movement_invoice_transaction_credit.getStartDate())
-      self.assertEquals(expected_time_frame_list[idx+1],
+      self.assertEquals(expected_stop_date,
         simulation_movement_invoice_transaction_credit.getStopDate())
 
       self.assertEquals(1.0,
@@ -276,9 +298,9 @@ class TestVifibOpenOrderSimulation(TestVifibSlapWebServiceMixin):
         simulation_movement_invoice_transaction_debit.getSpecialise())
       self.assertEquals("vifib/accounting",
         simulation_movement_invoice_transaction_debit.getTradePhase())
-      self.assertEquals(expected_time_frame_list[idx+1],
+      self.assertEquals(expected_start_date,
         simulation_movement_invoice_transaction_debit.getStartDate())
-      self.assertEquals(expected_time_frame_list[idx+1],
+      self.assertEquals(expected_stop_date,
         simulation_movement_invoice_transaction_debit.getStopDate())
 
       # credit simulation movement has no content
@@ -311,7 +333,17 @@ class TestVifibOpenOrderSimulation(TestVifibSlapWebServiceMixin):
             simulation_movement_credit_payment_debit = \
               simulation_movement_credit_payment.getObject()
       self.assertNotEquals(None, simulation_movement_credit_payment_credit)
+      # not delivered nor buildable
+      self.assertEqual(None, simulation_movement_credit_payment_credit\
+        .getDelivery())
+      self.assertFalse(simulation_movement_credit_payment_credit\
+        .isBuildable())
       self.assertNotEquals(None, simulation_movement_credit_payment_debit)
+      # not delivered nor buildable
+      self.assertEqual(None, simulation_movement_credit_payment_debit\
+        .getDelivery())
+      self.assertFalse(simulation_movement_credit_payment_debit\
+        .isBuildable())
 
       # check payment level of simulation
       self.assertEquals(-1.0,
@@ -334,9 +366,9 @@ class TestVifibOpenOrderSimulation(TestVifibSlapWebServiceMixin):
         simulation_movement_credit_payment_credit.getSpecialise())
       self.assertEquals("vifib/payment",
         simulation_movement_credit_payment_credit.getTradePhase())
-      self.assertEquals(expected_time_frame_list[idx+1],
+      self.assertEquals(expected_start_date,
         simulation_movement_credit_payment_credit.getStartDate())
-      self.assertEquals(expected_time_frame_list[idx+1],
+      self.assertEquals(expected_stop_date,
         simulation_movement_credit_payment_credit.getStopDate())
 
       self.assertEquals(1.0,
@@ -359,9 +391,9 @@ class TestVifibOpenOrderSimulation(TestVifibSlapWebServiceMixin):
         simulation_movement_credit_payment_debit.getSpecialise())
       self.assertEquals("vifib/payment",
         simulation_movement_credit_payment_debit.getTradePhase())
-      self.assertEquals(expected_time_frame_list[idx+1],
+      self.assertEquals(expected_start_date,
         simulation_movement_credit_payment_debit.getStartDate())
-      self.assertEquals(expected_time_frame_list[idx+1],
+      self.assertEquals(expected_stop_date,
         simulation_movement_credit_payment_debit.getStopDate())
 
       # check next simulation movement
@@ -376,7 +408,7 @@ class TestVifibOpenOrderSimulation(TestVifibSlapWebServiceMixin):
     sequence_list = SequenceList()
     sequence_string = \
         self.prepare_installed_computer_partition_sequence_string + """
-      LoginDefaultUser
+      LoginERP5TypeTestCase
       CheckSimulationMovement
       Tic
       SlapLogout
diff --git a/master/product/Vifib/tests/testVifibSlapComputerPartitionRequest.py b/master/product/Vifib/tests/testVifibSlapComputerPartitionRequest.py
index 2995eab6551db311dc71569dec72b79de04f9771..2391043bff9ee8babe4c8de7d108a0589779d35c 100644
--- a/master/product/Vifib/tests/testVifibSlapComputerPartitionRequest.py
+++ b/master/product/Vifib/tests/testVifibSlapComputerPartitionRequest.py
@@ -1226,7 +1226,7 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
       filter_kw=sequence.get('requested_filter_dict', {}),
       state=sequence.get('instance_state'))
 
-    requested_slap_computer_partition = slap_computer_partition.request(**kw)
+    slap_computer_partition.request(**kw)
 
   def stepCheckRequestComputerPartitionWithAnotherSoftwareType(
                                      self, sequence, **kw):
diff --git a/master/product/Vifib/tests/testVifibSlapOpenOrderRequest.py b/master/product/Vifib/tests/testVifibSlapOpenOrderRequest.py
index 5529ebd88f4312ec042ae74522b55789bc424a13..a5ab9f58add2e7e03502b7ca1905c9a4e035d9d6 100644
--- a/master/product/Vifib/tests/testVifibSlapOpenOrderRequest.py
+++ b/master/product/Vifib/tests/testVifibSlapOpenOrderRequest.py
@@ -1,5 +1,4 @@
 from Products.ERP5Type.tests.Sequence import SequenceList
-from Products.ERP5Type.tests.backportUnittest import expectedFailure
 import unittest
 from testVifibSlapWebService import TestVifibSlapWebServiceMixin
 from slapos import slap
@@ -131,7 +130,7 @@ class TestVifibSlapOpenOrderRequest(TestVifibSlapWebServiceMixin):
     self.slap = slap.slap()
     self.slap.initializeConnection(self.server_url, timeout=None)
     open_order = self.slap.registerOpenOrder()
-    requested_slap_computer_partition = open_order.request(
+    open_order.request(
        software_release=software_release,
        software_type="SecondSoftwareType",
        partition_reference=sequence['requested_reference'],
diff --git a/master/product/Vifib/tests/testVifibSlapWebService.py b/master/product/Vifib/tests/testVifibSlapWebService.py
index 42650eb2cbebc76992c07a56b16cf686a73c9f85..11c4a2894feac421c35b6a1bae0e8a5d1311198b 100644
--- a/master/product/Vifib/tests/testVifibSlapWebService.py
+++ b/master/product/Vifib/tests/testVifibSlapWebService.py
@@ -31,7 +31,6 @@ from DateTime import DateTime
 from AccessControl.SecurityManagement import newSecurityManager
 from Products.ERP5Type.Errors import UnsupportedWorkflowMethod
 from Products.ERP5Type.tests.Sequence import SequenceList
-from Products.ERP5Type.tests.backportUnittest import expectedFailure
 from Products.ERP5Type.tests.backportUnittest import skip
 from Products.ERP5Type.tests.SecurityTestCase import AssertNoPermissionMethod, \
     AssertPermissionMethod
@@ -4179,7 +4178,7 @@ class TestVifibSlapWebService(TestVifibSlapWebServiceMixin):
 
   def stepPersonRequestCredentialUpdate(self, sequence, **kw):
     sequence['updated_last_name'] = 'Another'
-    result = self.portal.ERP5Site_newPersonCredentialUpdate(
+    self.portal.ERP5Site_newPersonCredentialUpdate(
         first_name='Homer',
         last_name=sequence['updated_last_name'],
         reference=sequence['web_user'],
diff --git a/master/product/Vifib/tests/testVifibSlapWebServiceSlaveInstance.py b/master/product/Vifib/tests/testVifibSlapWebServiceSlaveInstance.py
index 4ca522da552bf8fd44edc6123dd35970f4d3e41a..e2e0f1cf534f7ef728d7fb81d38b9b87b8c7b552 100644
--- a/master/product/Vifib/tests/testVifibSlapWebServiceSlaveInstance.py
+++ b/master/product/Vifib/tests/testVifibSlapWebServiceSlaveInstance.py
@@ -790,6 +790,73 @@ class TestVifibSlapWebServiceSlaveInstance(TestVifibSlapWebServiceMixin):
     sequence_list.addSequenceString(sequence_string)
     sequence_list.play(self)
 
+  def test_SlaveInstance_destroy_slave_with_SlaveInstance_stopped(self):
+    """
+      Check that request destroy from Software Instance when exists one Slave
+      Instance stopped, both instances will be destroyed correctly
+
+      Scenario:
+        1. request master instance
+        2. request Slave Instance
+        3. stop Slave Instance
+        4. request destroy the master instance
+      Both instances must be destroyed
+    """
+    sequence_list = SequenceList()
+    sequence_string = self.prepare_install_requested_computer_partition_sequence_string + """
+      Tic
+      SlapLoginCurrentComputer
+      SoftwareInstanceAvailable
+      Tic
+      CheckEmptySlaveInstanceListFromOneComputerPartition
+      SlapLoginCurrentSoftwareInstance
+      SelectEmptyRequestedParameterDict
+      SetRandomRequestedReference
+      RequestSlaveInstanceFromComputerPartition
+      SlapLogout
+      LoginDefaultUser
+      ConfirmOrderedSaleOrderActiveSense
+      Tic
+      Logout
+      SlapLoginCurrentSoftwareInstance
+      RequestSlaveInstanceFromComputerPartition
+      SlapLogout
+      SlapLoginCurrentComputer
+      SoftwareInstanceAvailable
+      Tic
+      LoginDefaultUser
+      StartSoftwareInstanceFromCurrentComputerPartition
+      Logout
+      Tic
+      SoftwareInstanceStarted
+      Tic
+      SlapLogout
+      LoginDefaultUser
+      SelectSlaveInstanceFromOneComputerPartition
+      SlapLoginCurrentSoftwareInstance
+      RequestSoftwareInstanceStop
+      Tic
+      SlaveInstanceStopped
+      Tic
+      CheckComputerPartitionInstanceHostingSalePackingListStarted
+      CheckComputerPartitionInstanceHostingSalePackingListDelivered
+      SetDeliveryLineAmountEqualTwo
+      CheckComputerPartitionInstanceSetupSalePackingListStopped
+      RequestDestroySoftwareInstanceFromCurrentComputerPartition
+      Tic
+      CheckComputerPartitionInstanceCleanupSalePackingListConfirmed
+      Logout
+      SlapLoginCurrentComputer
+      SoftwareInstanceDestroyed
+      Tic
+      LoginDefaultUser
+      CheckComputerPartitionIsFree
+      CheckComputerPartitionInstanceCleanupSalePackingListDelivered
+      CheckComputerPartitionInstanceSetupSalePackingListDelivered
+    """
+    sequence_list.addSequenceString(sequence_string)
+    sequence_list.play(self)
+
   def test_Security_after_destroy_SoftwareInstance_with_different_user(self):
     """
       Check that destroying one Software Instance it will not destroy Slave
diff --git a/master/product/Vifib/tests/testVifibUsageReport.py b/master/product/Vifib/tests/testVifibUsageReport.py
index b0b7e40e57ce313ee41681c71aba6c7ed74356f9..b992467411ec591c7281ba5ef02d03173a51df64 100644
--- a/master/product/Vifib/tests/testVifibUsageReport.py
+++ b/master/product/Vifib/tests/testVifibUsageReport.py
@@ -28,7 +28,6 @@
 #############################################################################
 import unittest
 
-from DateTime import DateTime
 from lxml import etree
 from slapos import slap
 from testVifibSlapWebService import TestVifibSlapWebServiceMixin