Skip to Content
Menú
This question has been flagged
1 Respondre
3402 Vistes

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
Descartar
Best Answer

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
Descartar
Related Posts Respostes Vistes Activitat
1
de juny 19
5488
0
de març 15
4536
1
de març 15
9270
4
de gen. 17
7868
1
de nov. 15
6054