Odoo Help


get a list of users ids

on 3/24/16, 10:37 AM 1,171 views

first, i want to get a list of users ids, and then choose randomly an id from that list

Could you be more specific? What's the purpose of that?

Ermin Trevisan
on 3/24/16, 10:56 AM

i want to use this in a helpdesk module to assign tasks randomly to users.

on 3/24/16, 11:15 AM

Ermin Trevisan

--Ermin Trevisan--
| 6 5 7
Walchwil, Switzerland
--Ermin Trevisan--

Ermin Trevisan
On 3/24/16, 11:50 AM

The ID of the model res.users is an integer. So you could load the list and select one using a python random function, see for example https://docs.python.org/2/library/random.html.

But maybe you would rather use the model hr.employee to make sure you choose a real employee and not admin or sales or whatever :-)

I used the random.choice() function, but it doesn't work!!

on 3/24/16, 12:15 PM

Good point Ermin :)

Dr Obx
on 3/24/16, 12:17 PM

Axel Mendoza

--Axel Mendoza--
| 7 8 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full-time employee trying to understand what to do and how

Reach me at aekroft@gmail.com

Axel Mendoza
On 3/25/16, 9:37 PM

Better you use some another strategy instead of random selection because you could end up with overloaded users while others with nothing to do. I suggest a round robin strategy for that

Dr Obx
On 3/24/16, 11:16 AM

Internal lottery :)

chosen = fired!

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 3/24/16, 10:37 AM
Seen: 1171 times
Last updated: 3/25/16, 9:37 PM