Skip to Content
Menu
This question has been flagged
1 Atsakyti
3621 Rodiniai

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)

Portretas
Atmesti
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
Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
1
birž. 19
5736
0
kov. 15
4891
1
kov. 15
9643
4
saus. 17
8241
1
lapkr. 15
6337