跳至內容
選單
此問題已被標幟
1 回覆
3616 瀏覽次數

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)

頭像
捨棄
最佳答案

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
頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
6月 19
5732
0
3月 15
4874
1
3月 15
9619
4
1月 17
8234
1
11月 15
6332