Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
8158 Lượt xem

I can not understand when and how precompute=True can be used in computed fields. What difference does it make?


Thank You!

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi Karan BK,

Odoo16: Add precompute=True option in your Computed fields to compute value before Record Create, UpTo 15.0 version Computed field value was computed after Record Create.

If you need more information then:

  • whether the field should be computed before record insertion in database. Should be used to specify manually some fields as precompute=True when the field can be computed before record insertion.
  • Inside odoo documatation ctrl+F and search precompute=True .
  • https://www.odoo.com/documentation/16.0


Thank you


Ảnh đại diện
Huỷ bỏ
Tác giả

Hello Nikhil,
I have gone through the documentation and I know by setting precompute=True, computed fields will be computed before record create. But what I wanted to know is what difference does it make when computation is done before or after record create. When we should set precompute=True on a computed field and what is the purpose of using it.

Tác giả

This commit is helpful. Thanks Nikhil.

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 4 24
2339
0
thg 1 24
1763
2
thg 6 23
4557
1
thg 5 23
3415
1
thg 6 25
15273