Commit a4a1f573 authored by Antoine Catton's avatar Antoine Catton

Merge branch 'master' into rename_instance

Conflicts:
	master/bt5/vifib_base/bt/revision
	master/bt5/vifib_slap/bt/revision
parents 489c93a5 f5852e98
...@@ -320,25 +320,15 @@ ...@@ -320,25 +320,15 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string>select_dict= {\'delivery_uid\': None}\n
kw[\'select_dict\']=select_dict\n
from Products.ERP5Type.DateUtils import getClosestDate\n kw[\'left_join_list\']=select_dict.keys()\n
from DateTime import DateTime\n kw[\'delivery_uid\']=None\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
if src__==0:\n if src__==0:\n
return context.portal_catalog(**kw)\n return context.portal_catalog(**kw)\n
\n
else:\n else:\n
return context.portal_catalog(src__=1, **kw)\n return context.portal_catalog(src__=1, **kw)\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
......
...@@ -50,14 +50,12 @@ ...@@ -50,14 +50,12 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <value> <string>portal_catalog = context.getPortalObject().portal_catalog\n
accounting_module = portal.getDefaultModule(\'Sale Invoice Transaction\')\n simulation_state = \'planned\'\n
\n # use catalog to prefetch, but check later in ZODB\n
invoice = accounting_module.searchFolder(\n return [q.getObject() for q in portal_catalog(\n
portal_type=\'Sale Invoice Transaction\',\n portal_type=\'Sale Invoice Transaction\',\n
simulation_state=\'planned\')\n simulation_state=simulation_state) if q.getSimulationState() == simulation_state]\n
\n
return invoice\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -50,20 +50,10 @@ ...@@ -50,20 +50,10 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string>"""This script is called on the Invoice after the delivery builder has created\n
"""This script is called on the Invoice after the delivery builder has created\n
the new Invoice.\n the new Invoice.\n
"""\n """\n
from Products.ERP5Type.Message import translateString\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 \n
if related_simulation_movement_path_list is None:\n if related_simulation_movement_path_list is None:\n
raise RuntimeError, \'related_simulation_movement_path_list is missing. Update ERP5 Product.\'\n raise RuntimeError, \'related_simulation_movement_path_list is missing. Update ERP5 Product.\'\n
...@@ -75,60 +65,17 @@ if not invoice.Invoice_isAdvanced():\n ...@@ -75,60 +65,17 @@ if not invoice.Invoice_isAdvanced():\n
if not invoice.getResource():\n if not invoice.getResource():\n
invoice.setResource(invoice.getPriceCurrency())\n invoice.setResource(invoice.getPriceCurrency())\n
\n \n
related_packing_list = invoice.getDefaultCausalityValue()\n # initialize accounting_workflow to planned state\n
related_order = related_packing_list.getDefaultCausalityValue()\n plan_tag = \'%s_plan\' % invoice.getPath()\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
if invoice.getSimulationState() == \'draft\':\n if invoice.getSimulationState() == \'draft\':\n
invoice.activate(after_path_and_method_id=(related_simulation_movement_path_list,\n invoice.activate(after_path_and_method_id=(related_simulation_movement_path_list,\n
(\'immediateReindexObject\',\'recursiveImmediateReindexObject\')),\n (\'immediateReindexObject\',\'recursiveImmediateReindexObject\')),\n
tag=confirm_tag).Delivery_confirm()\n tag=plan_tag).plan(comment=translateString(\'Initialised by Delivery Builder.\'))\n
else:\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 invoice.activate(after_path_and_method_id=(related_simulation_movement_path_list,\n
(\'immediateReindexObject\',\'recursiveImmediateReindexObject\')),\n (\'immediateReindexObject\',\'recursiveImmediateReindexObject\')),\n
tag=confirm_tag).Delivery_expandAndBuild()\n tag=plan_tag).Delivery_expandAndBuild()\n
\n \n
# First set the invoice in the building state on the causality workflow\n # First set the invoice in the building state on the causality workflow\n
invoice.startBuilding()\n invoice.startBuilding()\n
...@@ -136,10 +83,22 @@ invoice.startBuilding()\n ...@@ -136,10 +83,22 @@ invoice.startBuilding()\n
# Then an activity should put the causality state in diverged or solved\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 invoice.activate(after_path_and_method_id=(related_simulation_movement_path_list,\n
(\'immediateReindexObject\',\'recursiveImmediateReindexObject\')),\n (\'immediateReindexObject\',\'recursiveImmediateReindexObject\')),\n
after_tag=confirm_tag).updateCausalityState()\n after_tag=plan_tag).updateCausalityState()\n
\n
# update casuality from movements\n
]]></string> </value> 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>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
......
340 346
\ No newline at end of file \ No newline at end of file
...@@ -63,9 +63,7 @@ ...@@ -63,9 +63,7 @@
<item> <item>
<key> <string>aggregated_portal_type</string> </key> <key> <string>aggregated_portal_type</string> </key>
<value> <value>
<tuple> <tuple/>
<string>Usage Report</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
88 89
\ No newline at end of file \ No newline at end of file
...@@ -50,7 +50,6 @@ ...@@ -50,7 +50,6 @@
<value> <value>
<tuple> <tuple>
<string>trade_phase/vifib/accounting</string> <string>trade_phase/vifib/accounting</string>
<string>trade_date/trade_phase/vifib/invoicing</string>
<string>source/account_module/sales</string> <string>source/account_module/sales</string>
<string>destination/account_module/purchase</string> <string>destination/account_module/purchase</string>
</tuple> </tuple>
......
...@@ -50,7 +50,6 @@ ...@@ -50,7 +50,6 @@
<value> <value>
<tuple> <tuple>
<string>trade_phase/vifib/accounting</string> <string>trade_phase/vifib/accounting</string>
<string>trade_date/trade_phase/vifib/invoicing</string>
<string>source/account_module/receivable</string> <string>source/account_module/receivable</string>
<string>destination/account_module/payable</string> <string>destination/account_module/payable</string>
</tuple> </tuple>
......
...@@ -114,9 +114,7 @@ ...@@ -114,9 +114,7 @@
<key> <string>completed_state</string> </key> <key> <string>completed_state</string> </key>
<value> <value>
<tuple> <tuple>
<string>confirmed</string>
<string>delivered</string> <string>delivered</string>
<string>started</string>
<string>stopped</string> <string>stopped</string>
</tuple> </tuple>
</value> </value>
......
...@@ -70,7 +70,6 @@ ...@@ -70,7 +70,6 @@
<value> <value>
<tuple> <tuple>
<string>trade_phase/vifib/delivery</string> <string>trade_phase/vifib/delivery</string>
<string>trade_date/trade_phase/vifib/order</string>
<string>end_of/day</string> <string>end_of/day</string>
</tuple> </tuple>
</value> </value>
......
...@@ -49,7 +49,6 @@ ...@@ -49,7 +49,6 @@
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple>
<string>trade_date/trade_phase/vifib/delivery</string>
<string>trade_phase/vifib/invoicing</string> <string>trade_phase/vifib/invoicing</string>
</tuple> </tuple>
</value> </value>
......
...@@ -50,7 +50,6 @@ ...@@ -50,7 +50,6 @@
<value> <value>
<tuple> <tuple>
<string>trade_phase/vifib/order</string> <string>trade_phase/vifib/order</string>
<string>trade_date/trade_phase/vifib/order</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
<string>trade_phase/vifib/payment</string> <string>trade_phase/vifib/payment</string>
<string>source/account_module/receivable</string> <string>source/account_module/receivable</string>
<string>destination/account_module/payable</string> <string>destination/account_module/payable</string>
<string>trade_date/trade_phase/vifib/invoicing</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
<string>trade_phase/vifib/payment</string> <string>trade_phase/vifib/payment</string>
<string>source/account_module/bank</string> <string>source/account_module/bank</string>
<string>destination/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> <string>source_payment/organisation_module/vifib_internet/bank_account</string>
</tuple> </tuple>
</value> </value>
......
...@@ -37,21 +37,12 @@ ...@@ -37,21 +37,12 @@
<key> <string>tested_property</string> </key> <key> <string>tested_property</string> </key>
<value> <value>
<tuple> <tuple>
<string>specialise</string>
<string>delivery_mode</string> <string>delivery_mode</string>
<string>incoterm</string> <string>incoterm</string>
<string>source</string> <string>source</string>
<string>destination</string> <string>destination</string>
<string>source_section</string> <string>source_section</string>
<string>destination_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> <string>price_currency</string>
</tuple> </tuple>
</value> </value>
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
<key> <string>tested_property</string> </key> <key> <string>tested_property</string> </key>
<value> <value>
<tuple> <tuple>
<string>specialise</string>
<string>resource</string> <string>resource</string>
<string>aggregate</string> <string>aggregate</string>
<string>quantity_unit</string> <string>quantity_unit</string>
...@@ -46,6 +47,14 @@ ...@@ -46,6 +47,14 @@
<string>destination_function</string> <string>destination_function</string>
<string>source_account</string> <string>source_account</string>
<string>destination_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> </tuple>
</value> </value>
</item> </item>
......
<?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>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple>
<string>collect_order_group/delivery</string> <string>collect_order_group/line</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <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>
<item> <item>
<key> <string>int_index</string> </key> <key> <string>int_index</string> </key>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <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> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
<?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>
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
<value> <value>
<tuple> <tuple>
<string>description</string> <string>description</string>
<string>start_date</string>
<string>stop_date</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -47,6 +49,10 @@ ...@@ -47,6 +49,10 @@
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>update_always</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
......
<?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>
64 72
\ No newline at end of file \ No newline at end of file
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
############################################################################## ###############################################################################
# #
# Copyright (c) 2002-2011 Nexedi SA and Contributors. All Rights Reserved. # Copyright (c) 2002-2011 Nexedi SA and Contributors. All Rights Reserved.
# #
...@@ -86,7 +86,6 @@ def SoftwareInstance_requestDestroySlaveInstanceRelated(self): ...@@ -86,7 +86,6 @@ def SoftwareInstance_requestDestroySlaveInstanceRelated(self):
computer_partition_relative_url = self.getAggregateRelatedValue( computer_partition_relative_url = self.getAggregateRelatedValue(
"Sale Packing List Line").getAggregate(portal_type="Computer Partition") "Sale Packing List Line").getAggregate(portal_type="Computer Partition")
portal_preferences = portal.portal_preferences portal_preferences = portal.portal_preferences
simulation_state = ["started", "confirmed"]
service_uid_list = [ service_uid_list = [
portal.restrictedTraverse(portal_preferences.getPreferredInstanceHostingResource()).getUid(), portal.restrictedTraverse(portal_preferences.getPreferredInstanceHostingResource()).getUid(),
portal.restrictedTraverse(portal_preferences.getPreferredInstanceSetupResource()).getUid(), portal.restrictedTraverse(portal_preferences.getPreferredInstanceSetupResource()).getUid(),
...@@ -95,10 +94,13 @@ def SoftwareInstance_requestDestroySlaveInstanceRelated(self): ...@@ -95,10 +94,13 @@ def SoftwareInstance_requestDestroySlaveInstanceRelated(self):
result_list = self.portal_catalog(portal_type="Sale Packing List Line", result_list = self.portal_catalog(portal_type="Sale Packing List Line",
aggregate_portal_type="Slave Instance", aggregate_portal_type="Slave Instance",
computer_partition_relative_url=computer_partition_relative_url, computer_partition_relative_url=computer_partition_relative_url,
simulation_state=simulation_state,
default_resource_uid=service_uid_list) default_resource_uid=service_uid_list)
slave_instance_list = [line.getAggregateValue(portal_type="Slave Instance") for line in result_list] slave_instance_list = [line.getAggregateValue(portal_type="Slave Instance") for line in result_list]
uid_list = []
for slave_instance in slave_instance_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( cleanup_packing_list = self.portal_catalog(
portal_type='Sale Packing List Line', portal_type='Sale Packing List Line',
aggregate_relative_url=slave_instance.getRelativeUrl(), aggregate_relative_url=slave_instance.getRelativeUrl(),
...@@ -106,6 +108,7 @@ def SoftwareInstance_requestDestroySlaveInstanceRelated(self): ...@@ -106,6 +108,7 @@ def SoftwareInstance_requestDestroySlaveInstanceRelated(self):
limit=1, limit=1,
) )
if len(cleanup_packing_list) == 0: if len(cleanup_packing_list) == 0:
uid_list.append(slave_instance_uid)
slave_instance.requestDestroyComputerPartition() slave_instance.requestDestroyComputerPartition()
finally: finally:
# Restore the original user. # Restore the original user.
......
<?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>
<?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>
...@@ -51,19 +51,11 @@ ...@@ -51,19 +51,11 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <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 for business_process in [\n
portal.business_process_module.vifib_sale_business_process,\n portal.business_process_module.vifib_sale_business_process,\n
portal.business_process_module.vifib_purchase_business_process]:\n portal.business_process_module.vifib_purchase_business_process]:\n
for link in business_process.contentValues(portal_type="Business Link"):\n for link in business_process.contentValues(portal_type="Business Link"):\n
link.build(**kw)\n link.build()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
489 490
\ No newline at end of file \ No newline at end of file
Computer Partition | jump_to_related_usage_report_list
System Preference | vifib_preference System Preference | vifib_preference
Virtio Partition | jump_to_related_usage_report_list
Virtio Partition | view Virtio Partition | view
\ No newline at end of file
...@@ -1226,7 +1226,7 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin): ...@@ -1226,7 +1226,7 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
filter_kw=sequence.get('requested_filter_dict', {}), filter_kw=sequence.get('requested_filter_dict', {}),
state=sequence.get('instance_state')) state=sequence.get('instance_state'))
requested_slap_computer_partition = slap_computer_partition.request(**kw) slap_computer_partition.request(**kw)
def stepCheckRequestComputerPartitionWithAnotherSoftwareType( def stepCheckRequestComputerPartitionWithAnotherSoftwareType(
self, sequence, **kw): self, sequence, **kw):
......
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.backportUnittest import expectedFailure
import unittest import unittest
from testVifibSlapWebService import TestVifibSlapWebServiceMixin from testVifibSlapWebService import TestVifibSlapWebServiceMixin
from slapos import slap from slapos import slap
...@@ -131,7 +130,7 @@ class TestVifibSlapOpenOrderRequest(TestVifibSlapWebServiceMixin): ...@@ -131,7 +130,7 @@ class TestVifibSlapOpenOrderRequest(TestVifibSlapWebServiceMixin):
self.slap = slap.slap() self.slap = slap.slap()
self.slap.initializeConnection(self.server_url, timeout=None) self.slap.initializeConnection(self.server_url, timeout=None)
open_order = self.slap.registerOpenOrder() open_order = self.slap.registerOpenOrder()
requested_slap_computer_partition = open_order.request( open_order.request(
software_release=software_release, software_release=software_release,
software_type="SecondSoftwareType", software_type="SecondSoftwareType",
partition_reference=sequence['requested_reference'], partition_reference=sequence['requested_reference'],
......
...@@ -31,7 +31,6 @@ from DateTime import DateTime ...@@ -31,7 +31,6 @@ from DateTime import DateTime
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.Errors import UnsupportedWorkflowMethod from Products.ERP5Type.Errors import UnsupportedWorkflowMethod
from Products.ERP5Type.tests.Sequence import SequenceList 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.backportUnittest import skip
from Products.ERP5Type.tests.SecurityTestCase import AssertNoPermissionMethod, \ from Products.ERP5Type.tests.SecurityTestCase import AssertNoPermissionMethod, \
AssertPermissionMethod AssertPermissionMethod
...@@ -4179,7 +4178,7 @@ class TestVifibSlapWebService(TestVifibSlapWebServiceMixin): ...@@ -4179,7 +4178,7 @@ class TestVifibSlapWebService(TestVifibSlapWebServiceMixin):
def stepPersonRequestCredentialUpdate(self, sequence, **kw): def stepPersonRequestCredentialUpdate(self, sequence, **kw):
sequence['updated_last_name'] = 'Another' sequence['updated_last_name'] = 'Another'
result = self.portal.ERP5Site_newPersonCredentialUpdate( self.portal.ERP5Site_newPersonCredentialUpdate(
first_name='Homer', first_name='Homer',
last_name=sequence['updated_last_name'], last_name=sequence['updated_last_name'],
reference=sequence['web_user'], reference=sequence['web_user'],
......
...@@ -790,6 +790,73 @@ class TestVifibSlapWebServiceSlaveInstance(TestVifibSlapWebServiceMixin): ...@@ -790,6 +790,73 @@ class TestVifibSlapWebServiceSlaveInstance(TestVifibSlapWebServiceMixin):
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) 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): def test_Security_after_destroy_SoftwareInstance_with_different_user(self):
""" """
Check that destroying one Software Instance it will not destroy Slave Check that destroying one Software Instance it will not destroy Slave
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
############################################################################# #############################################################################
import unittest import unittest
from DateTime import DateTime
from lxml import etree from lxml import etree
from slapos import slap from slapos import slap
from testVifibSlapWebService import TestVifibSlapWebServiceMixin from testVifibSlapWebService import TestVifibSlapWebServiceMixin
......
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