Odoo Help

Welcome!

This community 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.

0

get a list of users ids

By
Karim OUBHAT
on 3/24/16, 10:37 AM 507 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.

Karim OUBHAT
on 3/24/16, 11:15 AM
1

Ermin Trevisan

--Ermin Trevisan--
3524
| 6 3 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!!

Karim OUBHAT
on 3/24/16, 12:15 PM

Good point Ermin :)

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

Axel Mendoza

--Axel Mendoza--
10205
| 7 7 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 an 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

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

Internal lottery :)

chosen = fired!

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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