Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
3913 Widoki

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?

Awatar
Odrzuć
Najlepsza odpowiedź

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!

Awatar
Odrzuć
Najlepsza odpowiedź

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'}])


Awatar
Odrzuć
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.

Powiązane posty Odpowiedzi Widoki Czynność
0
kwi 24
1900
2
wrz 23
2407
0
gru 19
4607
5
gru 19
3686
0
sie 19
4