Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
3430 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
čvn 19
5528
0
bře 15
4591
1
bře 15
9330
4
led 17
7936
1
lis 15
6099