Commit 4266e82b authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5:

* link hosting subscription to project
* Hosting Subscription roles
* fixup test
* Instance can access project module
parent ae10a2b2
<local_roles_item>
<local_roles>
<role id='F-CUSTOMER'>
<item>Auditor</item>
</role>
<role id='F-PRODUCTION*'>
<item>Auditor</item>
</role>
</local_roles>
</local_roles_item>
\ No newline at end of file
......@@ -9,5 +9,8 @@
<role id='R-COMPUTER'>
<item>Auditor</item>
</role>
<role id='R-INSTANCE'>
<item>Auditor</item>
</role>
</local_roles>
</local_roles_item>
\ No newline at end of file
<type_roles>
<role id='Auditor'>
<property id='title'>Member</property>
<multi_property id='category'>function/customer</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Production</property>
<multi_property id='category'>function/production*</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Auditor'>
<property id='title'>Project Production Agent</property>
<property id='description'>XXX add local role group</property>
<property id='condition'>python: context.getFollowUp("") != ""</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='category'>function/production/agent</multi_property>
<multi_property id='base_category'>follow_up</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Project Production Manager</property>
<property id='description'>XXX add local role group</property>
<property id='condition'>python: context.getFollowUp("") != ""</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='category'>function/production/manager</multi_property>
<multi_property id='base_category'>follow_up</multi_property>
</role>
</type_roles>
\ No newline at end of file
......@@ -5,15 +5,18 @@
<multi_property id='base_category'>role</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Project Compute Node Manager</property>
<property id='description'>XXX TODO
add local roles group</property>
<multi_property id='category'>function/production*</multi_property>
<multi_property id='base_category'>function</multi_property>
<property id='title'>Instance</property>
<multi_property id='category'>role/instance</multi_property>
<multi_property id='base_category'>role</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Project Customer</property>
<property id='title'>Member</property>
<multi_property id='category'>function/customer</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Production</property>
<multi_property id='category'>function/production*</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
</type_roles>
\ No newline at end of file
......@@ -31,6 +31,10 @@
<type>Delivery Cell</type>
<workflow>-immobilisation_movement_interaction_workflow</workflow>
</chain>
<chain>
<type>Hosting Subscription</type>
<workflow>local_permission_slapos_interaction_workflow</workflow>
</chain>
<chain>
<type>Instance Node</type>
<workflow>local_permission_slapos_interaction_workflow</workflow>
......
......@@ -441,6 +441,7 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
# 2 credential request
# 1 open order
# 1 hosting subscription
# 2 accounting transaction
# 1 packing list
# 7 simulation mvt
......@@ -452,7 +453,7 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
# 3 allocation supply / line / cell
related_object_list = project.Base_getRelatedObjectList(**{'category.category_strict_membership': 1})
assert len(related_object_list) == 29, [x.getRelativeUrl() for x in related_object_list]
assert len(related_object_list) == 30, [x.getRelativeUrl() for x in related_object_list]
self.stepcheckERP5Consistency()
......@@ -655,6 +656,7 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
portal_type="Hosting Subscription",
# XXX hardcoded
ledger="automated",
follow_up_value=project,
)
hosting_subscription.validate()
start_date = hosting_subscription.HostingSubscription_calculateSubscriptionStartDate()
......@@ -721,6 +723,7 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
# Ensure no unexpected object has been created
# destination project:
# 1 open order
# 1 hosting subscription
# 2 accounting transaction
# 1 packing list
# 7 simulation mvt
......@@ -730,7 +733,7 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
# 1 open order line
related_object_list = project.Base_getRelatedObjectList(**{'category.category_strict_membership': 1})
assert len(related_object_list) == 14, [x.getRelativeUrl() for x in related_object_list]
assert len(related_object_list) == 15, [x.getRelativeUrl() for x in related_object_list]
self.stepcheckERP5Consistency()
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Interaction Workflow Interaction" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>after_script/portal_workflow/local_permission_slapos_interaction_workflow/script_Base_updateAllLocalRoles</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>interaction_HostingSubscription_edit</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Interaction Workflow Interaction</string> </value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<tuple>
<string>Hosting Subscription</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type_group_filter</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>HostingSubscription_edit</string> </value>
</item>
<item>
<key> <string>trigger_method_id</string> </key>
<value>
<tuple>
<string>_setFollowUp.*</string>
</tuple>
</value>
</item>
<item>
<key> <string>trigger_once_per_transaction</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -39,6 +39,7 @@ document_ingestion_module
document_module
event_module
event_module/slapos_crm_web_message_template
hosting_subscription_module
incident_response_module
instance_tree_module
invitation_token_module
......
......@@ -39,6 +39,8 @@ Event Module
Facebook Login
Fax Message
Google Login
Hosting Subscription
Hosting Subscription Module
Incident Response
Incident Response Module
Instance Node
......
......@@ -8,6 +8,7 @@ Computer Network | local_permission_slapos_interaction_workflow
Contract Invitation Token | edit_workflow
Contract Invitation Token | validation_workflow
Delivery Cell | -immobilisation_movement_interaction_workflow
Hosting Subscription | local_permission_slapos_interaction_workflow
Instance Node | local_permission_slapos_interaction_workflow
Instance Tree | local_permission_slapos_interaction_workflow
Integration Site | local_permission_slapos_interaction_workflow
......
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