Commit ddf5d9f5 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_erp5: Also set roles on SPL for subscription related movements

parent 4ae4cf08
Pipeline #10805 failed with stage
in 0 seconds
......@@ -7,7 +7,7 @@
</role>
<role id='Auditor'>
<property id='title'>Subscription Customer</property>
<property id='condition'>python: here.getSpecialise() in ('sale_trade_condition_module/slapos_subscription_trade_condition', 'sale_trade_condition_module/slapos_aggregated_trade_condition')</property>
<property id='condition'>python: here.getSpecialise() in ('sale_trade_condition_module/slapos_subscription_trade_condition', 'sale_trade_condition_module/slapos_aggregated_trade_condition', 'sale_trade_condition_module/slapos_aggregated_subscription_trade_condition')</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='categories'>local_role_group/user</multi_property>
<multi_property id='base_category'>destination_decision</multi_property>
......
......@@ -1021,6 +1021,23 @@ class TestSalePackingList(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(product, self.user_id, ['Owner'])
self.assertRoles(product, person.getUserId(), ['Auditor'])
def test_GroupCustomerAggregatedSubscription(self):
reference = 'TESTPERSON-%s' % self.generateNewId()
person = self.portal.person_module.newContent(portal_type='Person',
reference=reference)
product = self.portal.sale_packing_list_module.newContent(
portal_type='Sale Packing List',
destination_decision_value=person,
specialise_value=self.portal.sale_trade_condition_module.\
slapos_aggregated_subscription_trade_condition,
)
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', self.user_id, person.getUserId()], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, self.user_id, ['Owner'])
self.assertRoles(product, person.getUserId(), ['Auditor'])
class TestAccountingTransactionModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.accounting_module
......
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