Commit c254df44 authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5:

* test: fixup trade condition specialise
* configure 2 modules's business_application
* do not allow user to see each others
  Do not allow personal information to be visible to anybody
* allow Sale agent/manager to handle Assignments
* test: assignments are automaticall created when creating a virtual master
* test: fixup
* drop organisation pages
parent 8c5b9194
<type_roles>
<role id='Auditor'>
<property id='title'>Information System</property>
<property id='description'>XXX local role group</property>
<multi_property id='category'>function/is*</multi_property>
<role id='Assignee'>
<property id='title'>Sale Agent</property>
<multi_property id='categories'>local_role_group/function</multi_property>
<multi_property id='category'>function/sale/agent</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
<role id='Assignor'>
<property id='title'>Sale Manager</property>
<multi_property id='categories'>local_role_group/function</multi_property>
<multi_property id='category'>function/sale/manager</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
</type_roles>
\ No newline at end of file
......@@ -11,12 +11,6 @@
<multi_property id='category'>function/accounting/manager</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Project Member can see each other</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromChildAssignmentList</property>
<multi_property id='categories'>local_role_group/project</multi_property>
<multi_property id='base_category'>destination_project</multi_property>
</role>
<role id='Assignee'>
<property id='title'>Sale Agent</property>
<multi_property id='categories'>local_role_group/function</multi_property>
......
......@@ -12,8 +12,6 @@ url_list = [
"gadget_slapos_login_page.css",
"gadget_erp5_page_slap_accept_upgrade_decision.html",
"gadget_erp5_page_slap_accept_upgrade_decision.js",
"gadget_erp5_page_slap_organisation_get_invitation_link.js",
"gadget_erp5_page_slap_organisation_get_invitation_link.html",
"gadget_erp5_page_slap_project_get_invitation_link.js",
"gadget_erp5_page_slap_project_get_invitation_link.html",
"gadget_erp5_page_slap_add_project.html",
......@@ -36,8 +34,6 @@ url_list = [
"gadget_erp5_page_slap_request_contract_activation.html",
"gadget_erp5_page_slap_controller.html",
"gadget_erp5_page_slap_controller.js",
"gadget_erp5_page_slap_delete_organisation.html",
"gadget_erp5_page_slap_delete_organisation.js",
"gadget_erp5_page_slap_delete_project.html",
"gadget_erp5_page_slap_delete_project.js",
"gadget_erp5_page_slap_intent.html",
......@@ -51,8 +47,6 @@ url_list = [
"gadget_erp5_page_slap_invoice_list.js",
"gadget_erp5_page_slap_load_schema.html",
"gadget_erp5_page_slap_load_schema.js",
"gadget_erp5_page_slap_organisation_view.html",
"gadget_erp5_page_slap_organisation_view.js",
"gadget_erp5_page_slap_site_view.html",
"gadget_erp5_page_slap_site_view.js",
"gadget_erp5_page_slap_parameter_form.css",
......
......@@ -25,6 +25,7 @@ for business_application_id, module_name_list in [
"system_event_module",
]],
["slapos", [ # SlapOS
"allocation_supply_module",
"cloud_contract_module",
"compute_node_module",
"computer_module",
......@@ -38,6 +39,7 @@ for business_application_id, module_name_list in [
"project_module",
"software_installation_module",
"software_instance_module",
"subscription_request_module",
]],
["crm", [ # Customer Relation Management
"campaign_module",
......
......@@ -177,7 +177,7 @@ class TestSlapOSVirtualMasterScenarioMixin(DefaultScenarioMixin):
sale_trade_condition.validate()
# Create Trade Condition to create Deposit
sale_trade_condition = self.portal.sale_trade_condition_module.newContent(
self.portal.sale_trade_condition_module.newContent(
portal_type="Sale Trade Condition",
reference="For deposit",
trade_condition_type="deposit",
......@@ -185,8 +185,7 @@ class TestSlapOSVirtualMasterScenarioMixin(DefaultScenarioMixin):
source_value=seller_organisation,
source_section_value=seller_organisation,
price_currency_value=currency,
)
sale_trade_condition.validate()
).validate()
# Create Trade Condition to create Project
if is_virtual_master_accountable:
......@@ -277,9 +276,6 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
]
)
# first slapos administrator assignment can only be created by
# the erp5 manager
self.addProjectProductionManagerAssignment(owner_person, project)
self.tic()
self.logout()
......@@ -363,7 +359,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
# 1 credential request
# 1 instance tree
# 3 open sale order XXX * 2 why
# 2 assignment
# 3 assignment
# 3 simulation movement
# 3 sale packing list / line
# 2 sale trade condition ( a 3rd trade condition is not linked to the project)
......@@ -371,7 +367,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
# 1 software instance
# 1 software product
# 3 subscription request
self.assertRelatedObjectCount(project, 28)
self.assertRelatedObjectCount(project, 29)
self.checkERP5StateBeforeExit()
......@@ -429,10 +425,6 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
reference=owner_reference).getParentValue()
#owner_person.setCareerSubordinationValue(seller_organisation)
"""
# first slapos administrator assignment can only be created by
# the erp5 manager
self.addProjectProductionManagerAssignment(owner_person, project)"""
self.tic()
# hooray, now it is time to create compute_nodes
......@@ -587,7 +579,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
assert len(inventory_list) == 1, len(inventory_list)
assert inventory_list[0].quantity == 1, inventory_list[0].quantity
resource_vcl = [
'software_release/%s' % release_variation.getRelativeUrl(),
#'software_release/%s' % release_variation.getRelativeUrl(),
'software_type/%s' % type_variation.getRelativeUrl()
]
resource_vcl.sort()
......@@ -608,7 +600,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
# 2 credential request
# 1 instance tree
# 6 open sale order / line
# 3 (can reduce to 2) assignment
# 5 (can reduce to 2) assignment
# 16 simulation mvt
# 3 packing list / line
# 4 sale supply / line
......@@ -617,7 +609,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
# 1 software instance
# 1 software product
# 3 subscription requests
self.assertRelatedObjectCount(project, 50)
self.assertRelatedObjectCount(project, 52)
self.checkERP5StateBeforeExit()
......@@ -657,9 +649,6 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
'destination_project/%s' % project.getRelativeUrl()
]
)
# first slapos administrator assignment can only be created by
# the erp5 manager
self.addProjectProductionManagerAssignment(owner_person, project)
self.tic()
# hooray, now it is time to create compute_nodes
......@@ -760,7 +749,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
# 1 credential request
# 2 instance tree
# 9 open sale order / line
# 2 assignment
# 3 assignment
# 4 simulation movement
# 4 sale packing list
# 2 sale trade condition
......@@ -768,7 +757,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
# 2 software instance
# 2 software product
# 4 subscription request
self.assertRelatedObjectCount(project, 41)
self.assertRelatedObjectCount(project, 42)
self.checkERP5StateBeforeExit()
......@@ -808,9 +797,6 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
'destination_project/%s' % project.getRelativeUrl()
]
)
# first slapos administrator assignment can only be created by
# the erp5 manager
self.addProjectProductionManagerAssignment(owner_person, project)
self.tic()
# hooray, now it is time to create compute_nodes
......@@ -878,7 +864,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
# 1 credential request
# 1 instance tree
# 6 open sale order / line
# 2 assignments
# 3 assignments
# 3 simulation movements
# 3 sale packing list / line
# 2 sale trade condition
......@@ -886,7 +872,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
# 2 software instance
# 1 software product
# 3 subscription request
self.assertRelatedObjectCount(project, 29)
self.assertRelatedObjectCount(project, 30)
self.checkERP5StateBeforeExit()
......@@ -926,9 +912,6 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
'destination_project/%s' % remote_project.getRelativeUrl()
]
)
# first slapos administrator assignment can only be created by
# the erp5 manager
self.addProjectProductionManagerAssignment(remote_owner_person, remote_project)
self.tic()
# hooray, now it is time to create compute_nodes
......@@ -988,9 +971,6 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
'destination_project/%s' % project.getRelativeUrl()
]
)
# first slapos administrator assignment can only be created by
# the erp5 manager
self.addProjectProductionManagerAssignment(remote_public_person, project)
self.tic()
owner_person = remote_public_person
......@@ -1086,7 +1066,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
# 1 credential request
# 1 instance tree
# 6 open sale order / line
# 2 assignment
# 3 assignment
# 3 simulation movements
# 3 sale packing list / line
# 2 sale trade condition
......@@ -1094,7 +1074,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
# 1 software instance
# 1 software product
# 3 subscription requests
self.assertRelatedObjectCount(remote_project, 29)
self.assertRelatedObjectCount(remote_project, 30)
# Ensure no unexpected object has been created
# 3 allocation supply/line/cell
......@@ -1102,14 +1082,14 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
# 1 credential request
# 1 instance tree
# 4 open sale order / line
# 2 assignment
# 3 assignment
# 2 simulation movements
# 2 sale packing list / line
# 2 sale trade condition
# 1 software instance
# 1 software product
# 2 subscription requests
self.assertRelatedObjectCount(project, 22)
self.assertRelatedObjectCount(project, 23)
self.checkERP5StateBeforeExit()
......@@ -1149,9 +1129,6 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
'destination_project/%s' % remote_project.getRelativeUrl()
]
)
# first slapos administrator assignment can only be created by
# the erp5 manager
self.addProjectProductionManagerAssignment(remote_owner_person, remote_project)
self.tic()
# hooray, now it is time to create compute_nodes
......@@ -1229,9 +1206,6 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
'destination_project/%s' % project.getRelativeUrl()
]
)
# first slapos administrator assignment can only be created by
# the erp5 manager
self.addProjectProductionManagerAssignment(remote_public_person, project)
self.tic()
owner_person = remote_public_person
......@@ -1329,7 +1303,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
# 1 credential request
# 2 instance tree
# 9 open sale order / line
# 2 assignment
# 3 assignment
# 4 simulation movements
# 4 sale packing list / line
# 2 sale trade condition
......@@ -1337,7 +1311,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
# 2 software instance
# 1 software product
# 4 subscription requests
self.assertRelatedObjectCount(remote_project, 41)
self.assertRelatedObjectCount(remote_project, 42)
# Ensure no unexpected object has been created
# 3 allocation supply/line/cell
......@@ -1345,14 +1319,14 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
# 1 credential request
# 1 instance tree
# 4 open sale order / line
# 2 assignment
# 3 assignment
# 2 simulation movements
# 2 sale packing list / line
# 2 sale trade condition
# 1 software instance
# 1 software product
# 2 subscription requests
self.assertRelatedObjectCount(project, 22)
self.assertRelatedObjectCount(project, 23)
self.checkERP5StateBeforeExit()
......
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