Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3704 มุมมอง

Hello odoo community,

It might sound silly but im wondering if there is a function example that would fire without going to the tree view or form view?

Because most of the times when im writing the functions which stores values it fires only when i go to the tree view or form view.

For example lets say i have a function in res partner which calculates value X which is calculated from other table Y. If i would change value from table Y in the database res partner X value still be the same untill i will go to the tree view or form view which would be recalculated by the function.

Any examples and help would be appreciated

Thank you

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

field is computed when you access it. in your case field is accessed when you open tree view or form view. other hand if you'll access this field programmatically from a code (say: tmp = my_model_browserecord.X ), then it'll be calculated same way as if you open tree or form view. it's lazy calculation. I'm curious, why you want it to be calculated before you access it?

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ค. 25
359
0
ก.ค. 25
390
1
พ.ค. 25
880
0
มี.ค. 25
1007
0
มี.ค. 25
941