Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
3497 Weergaven

Hello

We have a job which aims at creating many ( > 500) object from a wizard. Those objects are from a custom model.
Creating each object and writing it to database is very slow; is it possible to prepare a dict of values et ask Odoo ORM to create every objects with only one DB call ?

Any help will be useful, thank you, community, by advance

Lionel (e-COSI)

Avatar
Annuleer
Beste antwoord

You can replace ORM functions search(), search_read() with PSQL select query. You can also use insert into the query to create records but it is not promoted.

eg:


query = "...."
cr.execute(query, params
Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
jun. 19
5594
0
mrt. 15
4656
1
mrt. 15
9397
4
jan. 17
8043
1
nov. 15
6169