Commit e94a14f4 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_cloud: group is mandatory for accountant Manager|Agent

parent 3ed044ad
...@@ -163,20 +163,23 @@ class SlapOSTestCaseMixin(testSlapOSMixin): ...@@ -163,20 +163,23 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
# Reset values set on script_ComputeNode_requestSoftwareReleaseChange # Reset values set on script_ComputeNode_requestSoftwareReleaseChange
self.portal.REQUEST.set(key, None) self.portal.REQUEST.set(key, None)
def _addAssignment(self, person, function, project=None): def _addAssignment(self, person, function, project=None, **kw):
assignment = person.newContent( assignment = person.newContent(
portal_type='Assignment', portal_type='Assignment',
destination_project_value=project, destination_project_value=project,
function=function function=function,
**kw
) )
assignment.open() assignment.open()
return assignment return assignment
def addAccountingManagerAssignment(self, person): def addAccountingManagerAssignment(self, person):
return self._addAssignment(person, 'accounting/manager') # group is mandatory for accountant
return self._addAssignment(person, 'accounting/manager', group='company')
def addAccountingAgentAssignment(self, person): def addAccountingAgentAssignment(self, person):
return self._addAssignment(person, 'accounting/agent') # group is mandatory for accountant
return self._addAssignment(person, 'accounting/agent', group='company')
def addSaleManagerAssignment(self, person): def addSaleManagerAssignment(self, person):
return self._addAssignment(person, 'sale/manager') return self._addAssignment(person, 'sale/manager')
......
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