Hey i am trying to make a particular user for purchase app only . I know ow to do it in a generic way but anyone can help me with how to do it for a particular app. Here is the code for generic read only
def set_read_only_user(self):
read_only_grp_id = self.env['ir.model.data'].get_object_reference('generic_read_only_user_app', 'group_read_only_user')[1]
if not self.read_only:
self.read_only = True
group_list = []
for group in self.groups_id:
group_list.append(group.id)
group_list.append(read_only_grp_id)
result= self.write({'groups_id':([(6,0,group_list)])})