Commit 0d758a48 authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5:

* test: slapos_panel_compatibility was added
* test: create Trade Condition for Deposit
* test:  slapos_panel_compatibility skin selection
* 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 1020859f
<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",
......
......@@ -202,6 +202,7 @@ erp5_xhtml_style
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -255,6 +256,7 @@ erp5_jquery_sheet_editor
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -295,6 +297,7 @@ erp5_jquery_sheet_editor
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -337,6 +340,7 @@ erp5_xhtml_style
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -379,6 +383,7 @@ erp5_xhtml_style
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : '\n'.join(common_folder_list.split('\n')[1:]),
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -417,6 +422,7 @@ erp5_jquery_sheet_editor
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -456,6 +462,7 @@ erp5_xhtml_style
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -494,6 +501,7 @@ erp5_jquery_sheet_editor
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -532,6 +540,7 @@ erp5_jquery_sheet_editor
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -571,6 +580,7 @@ erp5_jquery_sheet_editor
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -611,6 +621,7 @@ erp5_xhtml_style
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -651,6 +662,7 @@ erp5_xhtml_style
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -691,6 +703,7 @@ erp5_jquery_sheet_editor
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -732,6 +745,7 @@ erp5_xhtml_style
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -771,6 +785,7 @@ erp5_xhtml_style
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -808,6 +823,7 @@ erp5_xhtml_style
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -845,6 +861,7 @@ erp5_xhtml_style
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -882,6 +899,7 @@ erp5_xhtml_style
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -936,6 +954,7 @@ erp5_xhtml_style
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -973,6 +992,7 @@ erp5_xhtml_style
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -1010,6 +1030,7 @@ erp5_xhtml_style
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -1047,6 +1068,7 @@ erp5_xhtml_style
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -1084,6 +1106,7 @@ erp5_xhtml_style
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......@@ -1124,6 +1147,7 @@ erp5_xhtml_style
external_method
slapos_disaster_recovery
slapos_panel
slapos_panel_compatibility
""" % {'common_folder_list' : common_folder_list,
'common2_folder_list' : common2_folder_list,
'common3_folder_list' : common3_folder_list,
......
......@@ -176,6 +176,17 @@ class TestSlapOSVirtualMasterScenarioMixin(DefaultScenarioMixin):
)
sale_trade_condition.validate()
# Create Trade Condition to create Deposit
self.portal.sale_trade_condition_module.newContent(
portal_type="Sale Trade Condition",
reference="For deposit",
trade_condition_type="deposit",
specialise_value=sale_trade_condition,
source_value=seller_organisation,
source_section_value=seller_organisation,
price_currency_value=currency,
).validate()
# Create Trade Condition to create Project
if is_virtual_master_accountable:
source_section_value = seller_organisation
......@@ -265,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()
......@@ -351,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)
......@@ -359,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()
......@@ -417,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
......@@ -575,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()
......@@ -596,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
......@@ -605,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()
......@@ -645,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
......@@ -748,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
......@@ -756,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()
......@@ -796,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
......@@ -866,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
......@@ -874,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()
......@@ -914,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
......@@ -976,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
......@@ -1074,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
......@@ -1082,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
......@@ -1090,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()
......@@ -1137,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
......@@ -1217,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
......@@ -1317,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
......@@ -1325,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
......@@ -1333,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