Hi,
I have built an app for will which control access to various screens/fields via a field with in the app itself. I will have the assigneesManagers field (with other fields)
assigneesManagers = fields.Many2many('res.users', 'user_assignee_managers', 'npirequest_id','resusers_id', 'Assignees - Management')
This field will be populated by the person responsible and then when the form is pushed through to the next workflow state the application should be checking that the currently logged user exists within this many2many field (assigneesManagers), then we need to allow access to this user to update the orders faster.
The function being called when I push through the record from "draft" state to the next step only provides the one arguement of self. The only way I know to do this is to do an SQL query which requires the presence of the "Cr' object which doesn't seem to exist. I only have "self"
--------------------------------------------------------------------------------------------------------
@api.multi def action_draft(self):
self.assigneesManagers = [(0,[15])]
self.state = 'draft'
self.statePurchasing = 'draft' self.stateManufacturing = 'draft'
--------------------------------------------------------------------------------------------
I want to add another line to this that gets the logged in users name and then searches the assigneesManagers field to check if the user exists as an assigned manager.
Could somebody please help point me in the right direction for being able to do this. Just need to be able to find a match in a many2many field and return try if a match is found.
Looking forward to any rseponses.
Thanks,
Damien