Commit a7bb4552 authored by Romain Courteaud's avatar Romain Courteaud

Forbid allocation if an account has not been validated.

Add a new "Cloud Contract" document per user.
If the contract is validated, allow instance allocation.

Automatic contract approval is done if user already paid an invoice.
A validation invoice is automatically created if the user has no invoice.
parent 0feaf356
<?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_list</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_list</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>view</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>View</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>string:${object_url}/CloudContractModule_viewCloudContractList</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_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_view</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>view</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>View</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>string:${object_url}/CloudContract_view</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<module>
<id>cloud_contract_module</id>
<permission_list>
<permission type='tuple'>
<name>Access Transient Objects</name>
<role>Assignee</role>
<role>Assignor</role>
<role>Associate</role>
<role>Auditor</role>
<role>Author</role>
<role>Manager</role>
</permission>
<permission type='tuple'>
<name>Access contents information</name>
<role>Assignee</role>
<role>Assignor</role>
<role>Associate</role>
<role>Auditor</role>
<role>Author</role>
<role>Manager</role>
</permission>
<permission type='tuple'>
<name>Access session data</name>
<role>Assignee</role>
<role>Assignor</role>
<role>Associate</role>
<role>Auditor</role>
<role>Author</role>
<role>Manager</role>
</permission>
<permission type='tuple'>
<name>Add portal content</name>
<role>Assignor</role>
<role>Author</role>
<role>Manager</role>
</permission>
<permission type='tuple'>
<name>Add portal folders</name>
<role>Assignor</role>
<role>Author</role>
<role>Manager</role>
</permission>
<permission type='tuple'>
<name>Change local roles</name>
<role>Assignor</role>
<role>Manager</role>
</permission>
<permission type='tuple'>
<name>Copy or Move</name>
<role>Assignee</role>
<role>Assignor</role>
<role>Associate</role>
<role>Auditor</role>
<role>Author</role>
<role>Manager</role>
</permission>
<permission type='tuple'>
<name>Delete objects</name>
<role>Assignor</role>
<role>Manager</role>
</permission>
<permission type='tuple'>
<name>List folder contents</name>
<role>Assignee</role>
<role>Assignor</role>
<role>Associate</role>
<role>Auditor</role>
<role>Author</role>
<role>Manager</role>
</permission>
<permission type='tuple'>
<name>Modify portal content</name>
<role>Assignor</role>
<role>Manager</role>
</permission>
<permission type='tuple'>
<name>View</name>
<role>Assignee</role>
<role>Assignor</role>
<role>Associate</role>
<role>Auditor</role>
<role>Manager</role>
</permission>
<permission type='tuple'>
<name>View History</name>
<role>Assignee</role>
<role>Assignor</role>
<role>Associate</role>
<role>Auditor</role>
<role>Author</role>
<role>Manager</role>
</permission>
</permission_list>
<portal_type>Cloud Contract Module</portal_type>
<title>Cloud Contracts</title>
</module>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Sale Invoice Transaction" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>source_section/organisation_module/slapos</string>
<string>price_currency/currency_module/EUR</string>
<string>resource/currency_module/EUR</string>
<string>payment_mode/payzen</string>
<string>specialise/sale_trade_condition_module/slapos_aggregated_trade_condition</string>
</tuple>
</value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_destination_reference</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_contract_sale_invoice_transaction</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Sale Invoice Transaction</string> </value>
</item>
<item>
<key> <string>start_date</string> </key>
<value>
<object>
<klass>
<global id="1.1" name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1325372400.0</float>
<string>GMT+1</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>stop_date</string> </key>
<value>
<object>
<klass> <reference id="1.1"/> </klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1326582000.0</float>
<string>GMT+1</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Invoice Line" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>use/trade/sale</string>
<string>resource/service_module/slapos_account_validation</string>
<string>quantity_unit/unit/piece</string>
<string>base_contribution/base_amount/invoicing/discounted</string>
<string>base_contribution/base_amount/invoicing/taxable</string>
</tuple>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>1</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>1</string> </value>
</item>
<item>
<key> <string>index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>int_index</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Invoice Line</string> </value>
</item>
<item>
<key> <string>price</string> </key>
<value> <float>1.67224080268</float> </value>
</item>
<item>
<key> <string>quantity</string> </key>
<value> <float>1.0</float> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>movement</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Alarm" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>active_sense_method_id</string> </key>
<value> <string>Alarm_requestValidationPayment</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_contract_request_validation_payment</string> </value>
</item>
<item>
<key> <string>periodicity_hour</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_minute</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_minute_frequency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>periodicity_month</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_month_day</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_start_date</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1288051200.0</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>periodicity_week</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Alarm</string> </value>
</item>
<item>
<key> <string>sense_method_id</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Request Validation Payment</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<allowed_content_type_list> <allowed_content_type_list>
<portal_type id="Cloud Contract Module">
<item>Cloud Contract</item>
</portal_type>
<portal_type id="Consumption Document Module"> <portal_type id="Consumption Document Module">
<item>Computer Consumption TioXML File</item> <item>Computer Consumption TioXML File</item>
</portal_type> </portal_type>
......
<base_category_list> <base_category_list>
<portal_type id="Cloud Contract">
<item>causality</item>
<item>destination_section</item>
</portal_type>
<portal_type id="Cloud Contract Module">
<item>business_application</item>
</portal_type>
<portal_type id="Computer Consumption TioXML File"> <portal_type id="Computer Consumption TioXML File">
<item>contributor</item> <item>contributor</item>
</portal_type> </portal_type>
......
<hidden_content_type_list> <hidden_content_type_list>
<portal_type id="Cloud Contract Module">
<item>Cloud Contract</item>
</portal_type>
<portal_type id="Consumption Document Module"> <portal_type id="Consumption Document Module">
<item>Computer Consumption TioXML File</item> <item>Computer Consumption TioXML File</item>
</portal_type> </portal_type>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Base Type" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_property_domain_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>content_icon</string> </key>
<value> <string>folder_icon.gif</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>factory</string> </key>
<value> <string>addFolder</string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<tuple>
<string>module</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Cloud Contract Module</string> </value>
</item>
<item>
<key> <string>init_script</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>permission</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Base Type</string> </value>
</item>
<item>
<key> <string>type_class</string> </key>
<value> <string>Folder</string> </value>
</item>
<item>
<key> <string>type_interface</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>type_mixin</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>short_title</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>domain_name</string> </key>
<value> <string>erp5_ui</string> </value>
</item>
<item>
<key> <string>property_name</string> </key>
<value> <string>short_title</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>domain_name</string> </key>
<value> <string>erp5_ui</string> </value>
</item>
<item>
<key> <string>property_name</string> </key>
<value> <string>title</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Base Type" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>content_icon</string> </key>
<value> <string>document.gif</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>factory</string> </key>
<value> <string>addXMLObject</string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<tuple>
<string>item</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Cloud Contract</string> </value>
</item>
<item>
<key> <string>init_script</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>permission</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Base Type</string> </value>
</item>
<item>
<key> <string>type_class</string> </key>
<value> <string>Item</string> </value>
</item>
<item>
<key> <string>type_interface</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>type_mixin</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<workflow_chain> <workflow_chain>
<chain>
<type>Cloud Contract</type>
<workflow>edit_workflow, item_workflow</workflow>
</chain>
<chain> <chain>
<type>Computer Consumption TioXML File</type> <type>Computer Consumption TioXML File</type>
<workflow>document_conversion_interaction_workflow, document_publication_workflow, edit_workflow</workflow> <workflow>document_conversion_interaction_workflow, document_publication_workflow, edit_workflow</workflow>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>business_template_skin_layer_priority</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>float</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>business_template_skin_layer_priority</string> </key>
<value> <float>65.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_contract</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n
select_dict= {\'default_aggregate_uid\': None}\n
portal.portal_catalog.searchAndActivate(\n
portal_type=(\'Slave Instance\', \'Software Instance\'),\n
validation_state=\'validated\',\n
default_aggregate_uid=None,\n
select_dict=select_dict,\n
left_join_list=select_dict.keys(),\n
\n
method_id=\'SoftwareInstance_requestValidationPayment\',\n
packet_size=1, # Separate calls to many transactions\n
activate_kw={\'tag\': tag}\n
)\n
\n
context.activate(after_tag=tag).getId()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>tag, fixit, params</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Alarm_requestValidationPayment</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_doSelect</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>CloudContractModule_viewCloudContractList</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>CloudContractModule_viewCloudContractList</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_list</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Cloud Contracts</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>columns</string>
<string>selection_name</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>columns</string> </key>
<value>
<list>
<tuple>
<string>title</string>
<string>Title</string>
</tuple>
<tuple>
<string>default_destination_section_title</string>
<string>Client</string>
</tuple>
<tuple>
<string>translated_validation_state_title</string>
<string>State</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_list_mode_listbox</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value>
<list>
<tuple>
<string>Cloud Contract</string>
<string>Cloud Contract</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string>cloud_contract_module_selection</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Cloud Contracts</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_edit</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>my_title</string>
<string>my_destination_section_title</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list>
<string>my_translated_validation_state_title</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>CloudContract_view</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>CloudContract_view</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Cloud Contract</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n
person = context\n
contract_portal_type = "Cloud Contract"\n
\n
contract = portal.portal_catalog.getResultValue(\n
portal_type=contract_portal_type,\n
default_destination_section_uid=person.getUid(),\n
validation_state=\'validated\',\n
)\n
\n
if (contract is not None) and (contract.getValidationState() == "validated"):\n
return True\n
else:\n
return False\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Person_isAllowedToAllocate</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
from zExceptions import Unauthorized\n
if REQUEST is not None:\n
raise Unauthorized\n
\n
portal = context.getPortalObject()\n
software_instance = context\n
hosting_subscription = software_instance.getSpecialiseValue()\n
person = hosting_subscription.getDestinationSectionValue(portal_type=\'Person\')\n
payment_portal_type = "Payment Transaction"\n
contract_portal_type = "Cloud Contract"\n
\n
tag = "%s_requestValidationPayment_inProgress" % person.getUid()\n
if (portal.portal_activities.countMessageWithTag(tag) > 0):\n
# The cloud contract is already under creation but can not be fetched from catalog\n
# As it is not possible to fetch informations, it is better to raise an error\n
return None\n
\n
contract = portal.portal_catalog.getResultValue(\n
portal_type=contract_portal_type,\n
default_destination_section_uid=person.getUid(),\n
validation_state=[\'invalidated\', \'validated\'],\n
)\n
\n
if (contract is None):\n
# Prevent concurrent transaction to create 2 contracts for the same person\n
person.serialize()\n
\n
# Time to create the contract\n
contract = portal.cloud_contract_module.newContent(\n
portal_type=contract_portal_type,\n
title=\'Contract for "%s"\' % person.getTitle(),\n
destination_section_value=person\n
)\n
contract.validate(comment=\'New automatic contract for %s\' % context.getTitle())\n
contract.invalidate(comment=\'New automatic contract for %s\' % context.getTitle())\n
\n
contract.reindexObject(activate_kw={\'tag\': tag})\n
\n
if (contract.getValidationState() == "invalidated"):\n
# Prevent concurrent transaction to create 2 invoices for the same person\n
person.serialize()\n
\n
# search if the user already paid anything\n
payment = portal.portal_catalog.getResultValue(\n
portal_type=payment_portal_type,\n
default_destination_section_uid=person.getUid(),\n
simulation_state=[\'stopped\'],\n
)\n
\n
if (payment is None):\n
# Manually create an invoice to request payment validation\n
current_invoice = contract.getCausalityValue()\n
\n
if current_invoice is None:\n
# Create the validation invoice\n
# XXX Hardcoded\n
invoice_template = portal.restrictedTraverse("accounting_module/template_contract_sale_invoice_transaction")\n
current_invoice = invoice_template.Base_createCloneDocument(batch_mode=1)\n
contract.edit(causality_value=current_invoice)\n
contract.reindexObject(activate_kw={\'tag\': tag})\n
\n
current_invoice.edit(\n
title="Account validation",\n
source_value=person,\n
destination_value=person,\n
destination_section_value=person,\n
destination_decision_value=person,\n
start_date=DateTime(),\n
stop_date=None,\n
)\n
comment = "Validation invoice for contract %s" % contract.getRelativeUrl()\n
current_invoice.plan(comment=comment)\n
current_invoice.confirm(comment=comment)\n
current_invoice.startBuilding(comment=comment)\n
current_invoice.reindexObject(activate_kw={\'tag\': tag})\n
\n
\n
else:\n
# Check if the invoice is still ongoing\n
simulation_state = current_invoice.getSimulationState() \n
\n
if simulation_state in ("planned", "confirmed", "ordered", "started"):\n
# Waiting for payment\n
result = "ongoing"\n
elif simulation_state in ("cancelled", "deleted", "draft"):\n
result = "cancelled"\n
elif simulation_state in ("stopped", "delivered"):\n
# Invoice is in final state.\n
paid = True\n
for line in current_invoice.getMovementList(portal.getPortalAccountingMovementTypeList()):\n
node_value = line.getSourceValue(portal_type=\'Account\')\n
\n
if node_value.getAccountType() == \'asset/receivable\':\n
if not line.hasGroupingReference():\n
paid = False\n
break\n
\n
if paid:\n
result = "paid"\n
else:\n
result = "ongoing"\n
\n
else:\n
raise NotImplementedError, "Unknow state %s" % simulation_state\n
\n
if result in ("paid", "cancelled"):\n
# Maybe have been paid or not (mirror invoice may have been created)\n
# Check in next alarm loop for a payment\n
contract.edit(causality_value=None)\n
contract.reindexObject(activate_kw={\'tag\': tag})\n
\n
else:\n
# Found one payment, the contract can be validated\n
comment = "Contract validated as paid payment %s found" % payment.getRelativeUrl()\n
contract.validate(comment=comment)\n
contract.reindexObject(activate_kw={\'tag\': tag})\n
\n
return contract\n
]]></string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>REQUEST=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_requestValidationPayment</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
# Copyright (c) 2013 Nexedi SA and Contributors. All Rights Reserved.
import transaction
from Products.SlapOS.tests.testSlapOSMixin import \
testSlapOSMixin
from Products.ERP5Type.tests.utils import createZODBPythonScript
class TestSlapOSRequestValidationPayment(testSlapOSMixin):
def _makeSlaveTree(self, requested_template_id='template_slave_instance'):
super(TestSlapOSRequestValidationPayment, self).\
_makeTree(requested_template_id=requested_template_id)
def _simulateSoftwareInstance_requestValidationPayment(self):
script_name = 'SoftwareInstance_requestValidationPayment'
if script_name in self.portal.portal_skins.custom.objectIds():
raise ValueError('Precondition failed: %s exists in custom' % script_name)
createZODBPythonScript(self.portal.portal_skins.custom,
script_name,
'*args, **kwargs',
'# Script body\n'
"""portal_workflow = context.portal_workflow
portal_workflow.doActionFor(context, action='edit_action', comment='Visited by SoftwareInstance_requestValidationPayment') """ )
transaction.commit()
def _dropSoftwareInstance_requestValidationPayment(self):
script_name = 'SoftwareInstance_requestValidationPayment'
if script_name in self.portal.portal_skins.custom.objectIds():
self.portal.portal_skins.custom.manage_delObjects(script_name)
transaction.commit()
def test_alarm_software_instance_unallocated(self):
self._makeTree()
self._simulateSoftwareInstance_requestValidationPayment()
try:
self.portal.portal_alarms.slapos_contract_request_validation_payment.activeSense()
self.tic()
finally:
self._dropSoftwareInstance_requestValidationPayment()
self.assertEqual(
'Visited by SoftwareInstance_requestValidationPayment',
self.software_instance.workflow_history['edit_workflow'][-1]['comment'])
def test_alarm_slave_instance_unallocated(self):
self._makeSlaveTree()
self._simulateSoftwareInstance_requestValidationPayment()
try:
self.portal.portal_alarms.slapos_contract_request_validation_payment.activeSense()
self.tic()
finally:
self._dropSoftwareInstance_requestValidationPayment()
self.assertEqual(
'Visited by SoftwareInstance_requestValidationPayment',
self.software_instance.workflow_history['edit_workflow'][-1]['comment'])
def test_alarm_software_instance_allocated(self):
self._makeTree()
self._makeComputer()
self.software_instance.setAggregate(self.partition.getRelativeUrl())
self.tic()
self._simulateSoftwareInstance_requestValidationPayment()
try:
self.portal.portal_alarms.slapos_contract_request_validation_payment.activeSense()
self.tic()
finally:
self._dropSoftwareInstance_requestValidationPayment()
self.assertNotEqual(
'Visited by SoftwareInstance_requestValidationPayment',
self.software_instance.workflow_history['edit_workflow'][-1]['comment'])
def test_alarm_slave_instance_allocated(self):
self._makeSlaveTree()
self._makeComputer()
self.software_instance.setAggregate(self.partition.getRelativeUrl())
self.tic()
self._simulateSoftwareInstance_requestValidationPayment()
try:
self.portal.portal_alarms.slapos_contract_request_validation_payment.activeSense()
self.tic()
finally:
self._dropSoftwareInstance_requestValidationPayment()
self.assertNotEqual(
'Visited by SoftwareInstance_requestValidationPayment',
self.software_instance.workflow_history['edit_workflow'][-1]['comment'])
260 261
\ No newline at end of file \ No newline at end of file
Cloud Contract Module | view
Cloud Contract | view
Computer Consumption TioXML File | download Computer Consumption TioXML File | download
Computer Consumption TioXML File | view Computer Consumption TioXML File | view
Consumption Document Module | view Consumption Document Module | view
......
...@@ -6,4 +6,5 @@ service_module/slapos_instance_cleanup ...@@ -6,4 +6,5 @@ service_module/slapos_instance_cleanup
service_module/slapos_instance_setup service_module/slapos_instance_setup
service_module/slapos_instance_update service_module/slapos_instance_update
service_module/slapos_instance_subscription service_module/slapos_instance_subscription
service_module/slapos_netdrive_consumption service_module/slapos_netdrive_consumption
\ No newline at end of file service_module/slapos_account_validation
\ No newline at end of file
...@@ -4,6 +4,7 @@ service_module/slapos_instance_cleanup ...@@ -4,6 +4,7 @@ service_module/slapos_instance_cleanup
service_module/slapos_instance_setup service_module/slapos_instance_setup
service_module/slapos_instance_update service_module/slapos_instance_update
service_module/slapos_netdrive_consumption service_module/slapos_netdrive_consumption
service_module/slapos_account_validation
account_module/bank account_module/bank
account_module/capital account_module/capital
account_module/coll_vat account_module/coll_vat
......
cloud_contract_module
consumption_document_module consumption_document_module
\ No newline at end of file
...@@ -9,6 +9,8 @@ account_module/purchase ...@@ -9,6 +9,8 @@ account_module/purchase
account_module/receivable account_module/receivable
account_module/refundable_vat account_module/refundable_vat
account_module/sales account_module/sales
accounting_module/template_contract_sale_invoice_transaction
accounting_module/template_contract_sale_invoice_transaction/**
business_process_module/slapos_aggregated_business_process business_process_module/slapos_aggregated_business_process
business_process_module/slapos_aggregated_business_process/** business_process_module/slapos_aggregated_business_process/**
business_process_module/slapos_consumption_business_process business_process_module/slapos_consumption_business_process
...@@ -22,6 +24,7 @@ open_sale_order_module/slapos_accounting_open_sale_order_template ...@@ -22,6 +24,7 @@ open_sale_order_module/slapos_accounting_open_sale_order_template
organisation_module/slapos organisation_module/slapos
organisation_module/slapos/bank_account organisation_module/slapos/bank_account
portal_alarms/slapos_accounting_generate_packing_list_from_tioxml portal_alarms/slapos_accounting_generate_packing_list_from_tioxml
portal_alarms/slapos_contract_request_validation_payment
portal_alarms/slapos_deliver_started_aggregated_sale_packing_list portal_alarms/slapos_deliver_started_aggregated_sale_packing_list
portal_alarms/slapos_instance_invoicing portal_alarms/slapos_instance_invoicing
portal_alarms/slapos_manage_building_calculating_delivery portal_alarms/slapos_manage_building_calculating_delivery
...@@ -68,6 +71,7 @@ sale_trade_condition_module/slapos_aggregated_trade_condition/1 ...@@ -68,6 +71,7 @@ sale_trade_condition_module/slapos_aggregated_trade_condition/1
sale_trade_condition_module/slapos_consumption_trade_condition sale_trade_condition_module/slapos_consumption_trade_condition
sale_trade_condition_module/slapos_subscription_trade_condition sale_trade_condition_module/slapos_subscription_trade_condition
sale_trade_condition_module/slapos_subscription_trade_condition/** sale_trade_condition_module/slapos_subscription_trade_condition/**
service_module/slapos_account_validation
service_module/slapos_discount service_module/slapos_discount
service_module/slapos_instance_cleanup service_module/slapos_instance_cleanup
service_module/slapos_instance_setup service_module/slapos_instance_setup
......
Cloud Contract Module | Cloud Contract
Consumption Document Module | Computer Consumption TioXML File Consumption Document Module | Computer Consumption TioXML File
Order Tool | SlapOS Accounting Quantity Updating Order Builder Order Tool | SlapOS Accounting Quantity Updating Order Builder
Rule Tool | Subscription Item Root Simulation Rule Rule Tool | Subscription Item Root Simulation Rule
......
Cloud Contract Module | business_application
Cloud Contract | causality
Cloud Contract | destination_section
Computer Consumption TioXML File | contributor Computer Consumption TioXML File | contributor
Consumption Document Module | business_application Consumption Document Module | business_application
Slave Instance | causality Slave Instance | causality
......
Cloud Contract Module | Cloud Contract
Consumption Document Module | Computer Consumption TioXML File Consumption Document Module | Computer Consumption TioXML File
\ No newline at end of file
Cloud Contract
Cloud Contract Module
Computer Consumption TioXML File Computer Consumption TioXML File
Consumption Document Module Consumption Document Module
SlapOS Accounting Quantity Updating Order Builder SlapOS Accounting Quantity Updating Order Builder
......
Cloud Contract | edit_workflow
Cloud Contract | item_workflow
Computer Consumption TioXML File | document_conversion_interaction_workflow Computer Consumption TioXML File | document_conversion_interaction_workflow
Computer Consumption TioXML File | document_publication_workflow Computer Consumption TioXML File | document_publication_workflow
Computer Consumption TioXML File | edit_workflow Computer Consumption TioXML File | edit_workflow
......
slapos_accounting slapos_accounting
slapos_consumption slapos_consumption
slapos_contract
slapos_simulation slapos_simulation
\ No newline at end of file
testSlapOSAccountingSkins testSlapOSAccountingSkins
testSlapOSConsumptionSkins testSlapOSConsumptionSkins
testSlapOSContractAlarm
testSlapOSContractSkins
testSlapOSAccountingAlarm testSlapOSAccountingAlarm
testSlapOSAccountingBuilder testSlapOSAccountingBuilder
testSlapOSAccountingConstraint testSlapOSAccountingConstraint
......
<local_roles_item>
<local_roles>
<role id='G-COMPANY'>
<item>Auditor</item>
<item>Author</item>
</role>
<role id='zope'>
<item>Owner</item>
</role>
</local_roles>
</local_roles_item>
\ No newline at end of file
<local_roles_item>
<local_roles>
<role id='G-COMPANY'>
<item>Assignor</item>
</role>
<role id='R-MEMBER'>
<item>Auditor</item>
</role>
<role id='zope'>
<item>Owner</item>
</role>
</local_roles>
</local_roles_item>
\ No newline at end of file
<type_roles>
<role id='Author; Auditor'>
<property id='title'>Group company</property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
</type_roles>
\ No newline at end of file
...@@ -2021,3 +2021,22 @@ class TestComputerConsumptionTioXMLFile(TestSlapOSGroupRoleSecurityMixin): ...@@ -2021,3 +2021,22 @@ class TestComputerConsumptionTioXMLFile(TestSlapOSGroupRoleSecurityMixin):
False) False)
self.assertRoles(text, 'G-COMPANY', ['Assignor']) self.assertRoles(text, 'G-COMPANY', ['Assignor'])
self.assertRoles(text, self.user_id, ['Owner']) self.assertRoles(text, self.user_id, ['Owner'])
class TestCloudContractModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.cloud_contract_module
self.assertSecurityGroup(module,
['zope', 'G-COMPANY'], False)
self.assertRoles(module, 'G-COMPANY', ['Author', 'Auditor'])
self.assertRoles(module, 'zope', ['Owner'])
class TestCloudContract(TestSlapOSGroupRoleSecurityMixin):
def test_GroupCompany(self):
text = self.portal.cloud_contract_module.newContent(
portal_type='Cloud Contract')
self.assertSecurityGroup(text,
['G-COMPANY', self.user_id],
False)
self.assertRoles(text, 'G-COMPANY', ['Assignor'])
self.assertRoles(text, self.user_id, ['Owner'])
...@@ -112,6 +112,7 @@ class TestSlaposSkinSelection(testSlapOSMixin): ...@@ -112,6 +112,7 @@ class TestSlaposSkinSelection(testSlapOSMixin):
custom custom
slapos_upgrader slapos_upgrader
vifib_hosting vifib_hosting
slapos_contract
slapos_accounting slapos_accounting
slapos_administration slapos_administration
slapos_cache slapos_cache
...@@ -217,6 +218,7 @@ zpt_generic ...@@ -217,6 +218,7 @@ zpt_generic
""" """
custom custom
slapos_upgrader slapos_upgrader
slapos_contract
slapos_accounting slapos_accounting
slapos_administration slapos_administration
slapos_cache slapos_cache
...@@ -318,6 +320,7 @@ zpt_generic ...@@ -318,6 +320,7 @@ zpt_generic
""" """
custom custom
slapos_upgrader slapos_upgrader
slapos_contract
slapos_accounting slapos_accounting
slapos_administration slapos_administration
slapos_cache slapos_cache
...@@ -420,6 +423,7 @@ zpt_generic ...@@ -420,6 +423,7 @@ zpt_generic
""" """
custom custom
slapos_upgrader slapos_upgrader
slapos_contract
slapos_accounting slapos_accounting
slapos_administration slapos_administration
slapos_cache slapos_cache
...@@ -519,6 +523,7 @@ zpt_generic ...@@ -519,6 +523,7 @@ zpt_generic
""" """
custom custom
slapos_upgrader slapos_upgrader
slapos_contract
slapos_accounting slapos_accounting
slapos_administration slapos_administration
slapos_cache slapos_cache
...@@ -619,6 +624,7 @@ zpt_generic ...@@ -619,6 +624,7 @@ zpt_generic
""" """
custom custom
slapos_upgrader slapos_upgrader
slapos_contract
slapos_accounting slapos_accounting
slapos_administration slapos_administration
slapos_cache slapos_cache
...@@ -718,6 +724,7 @@ zpt_generic ...@@ -718,6 +724,7 @@ zpt_generic
""" """
custom custom
slapos_upgrader slapos_upgrader
slapos_contract
slapos_accounting slapos_accounting
slapos_administration slapos_administration
slapos_cache slapos_cache
...@@ -817,6 +824,7 @@ zpt_generic ...@@ -817,6 +824,7 @@ zpt_generic
""" """
custom custom
slapos_upgrader slapos_upgrader
slapos_contract
slapos_accounting slapos_accounting
slapos_administration slapos_administration
slapos_cache slapos_cache
...@@ -916,6 +924,7 @@ zpt_generic ...@@ -916,6 +924,7 @@ zpt_generic
""" """
custom custom
slapos_upgrader slapos_upgrader
slapos_contract
slapos_accounting slapos_accounting
slapos_administration slapos_administration
slapos_cache slapos_cache
...@@ -1017,6 +1026,7 @@ zpt_generic ...@@ -1017,6 +1026,7 @@ zpt_generic
""" """
custom custom
slapos_upgrader slapos_upgrader
slapos_contract
slapos_accounting slapos_accounting
slapos_administration slapos_administration
slapos_cache slapos_cache
......
173 174
\ No newline at end of file \ No newline at end of file
...@@ -17,6 +17,7 @@ business_process_module/slapos_aggregated_business_process ...@@ -17,6 +17,7 @@ business_process_module/slapos_aggregated_business_process
business_process_module/slapos_consumption_business_process business_process_module/slapos_consumption_business_process
business_process_module/slapos_subscription_business_process business_process_module/slapos_subscription_business_process
campaign_module campaign_module
cloud_contract_module
component_module component_module
computer_model_module computer_model_module
computer_module computer_module
...@@ -56,6 +57,7 @@ sale_order_module ...@@ -56,6 +57,7 @@ sale_order_module
sale_packing_list_module sale_packing_list_module
sale_trade_condition_module sale_trade_condition_module
service_module service_module
service_module/slapos_account_validation
service_module/slapos_discount service_module/slapos_discount
service_module/slapos_instance_subscription service_module/slapos_instance_subscription
service_module/slapos_netdrive_consumption service_module/slapos_netdrive_consumption
......
...@@ -17,6 +17,7 @@ business_process_module/slapos_aggregated_business_process ...@@ -17,6 +17,7 @@ business_process_module/slapos_aggregated_business_process
business_process_module/slapos_consumption_business_process business_process_module/slapos_consumption_business_process
business_process_module/slapos_subscription_business_process business_process_module/slapos_subscription_business_process
campaign_module campaign_module
cloud_contract_module
component_module component_module
computer_model_module computer_model_module
computer_module computer_module
...@@ -58,8 +59,9 @@ sale_trade_condition_module ...@@ -58,8 +59,9 @@ sale_trade_condition_module
service_module service_module
service_module/slapos_discount service_module/slapos_discount
service_module/slapos_instance_subscription service_module/slapos_instance_subscription
service_module/slapos_tax
service_module/slapos_netdrive_consumption service_module/slapos_netdrive_consumption
service_module/slapos_tax
service_module/slapos_account_validation
software_installation_module software_installation_module
software_instance_module software_instance_module
software_product_module software_product_module
......
...@@ -13,6 +13,8 @@ Business Process Module ...@@ -13,6 +13,8 @@ Business Process Module
Campaign Campaign
Campaign Module Campaign Module
Cash Register Cash Register
Cloud Contract
Cloud Contract Module
Component Component
Component Module Component Module
Computer Computer
......
...@@ -13,6 +13,8 @@ Business Process Module ...@@ -13,6 +13,8 @@ Business Process Module
Campaign Campaign
Campaign Module Campaign Module
Cash Register Cash Register
Cloud Contract
Cloud Contract Module
Component Component
Component Module Component Module
Computer Computer
......
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