Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
3920 Vizualizări

I need to create about 10000 users, using plain creating (edit: creating using Python code) will mostly exceed server time limit. Is there a proper way to do that?

Imagine profil
Abandonează
Cel mai bun răspuns

Hello Tung,

There is also another option which is more flexible.
What you need is to prepare a users.csv 

You can use import via the odoo web service.
below the link to the quite old post - but the idea is pretty smart, I think, especially if you really want to have the control of your users, it's number and of course - data.
The example is about importing products, but it's just the switching of data model.

https://erpmoldeo.wordpress.com/2011/05/10/importing-products-with-web-services-in-openerp/

That's just a suggestion, which I would like you to know about :)

Maybe this help you at a certain moment.

WIsh you luck!

Imagine profil
Abandonează
Cel mai bun răspuns

I once used code to create the users and restrict several parameters,and put them in the groups I wanted, but why do you want to create so many users anyway?

Here is an example of the code:

models.execute_kw(db, uid, password, 'res.users', 'create', [
{'name': 'user_name',
'login': 'user_email', # Must be different each time
'password': 'user_password',
'new_password': 'user_password',
'sel_groups_1_9_10': 1,
'sel_groups_20_21_22': 22,
'sel_groups_35_36': 36,
'sel_groups_49_50': 50,
'sel_groups_2_3': 3,
'sel_groups_26_28': 28,
'sel_groups_44_45': 45,
'notification_type': 'inbox',
'tz': 'time_zone'}])


Imagine profil
Abandonează
Autor

I'm working on a project that deals with a lot of students (the amount you expect from a real university). And I have to create users for them as well.

Autor

By the way with plain creating I mean using code like yours.

Then you could just iterate using a list? And assigning them the same name and password and make them change it on their first loggin? Also you could change the server time limit (although I think it disconnects at 8 minutes regardless of whatever time you put).
If that was the case you could always use small lists to iterate, like classroom list or alphabetical surname for each letter, etc...

By the way, I don't think its going to hit server time limit, because if you keep it simple and let python handle the opperation it will be like several opperations of create user, so there shouldn't be a problem.

Related Posts Răspunsuri Vizualizări Activitate
0
apr. 24
1900
2
sept. 23
2415
0
dec. 19
4608
5
dec. 19
3687
0
aug. 19
4