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

I have a computed field that depends on a relation. Somewhere in my code I update this relation by accessing directly the database (self.env.cr.execute). My question is how can I force the recomputation afterwards ?

In v7 I used the _store_set_values function which worked like a charm. But now this method seems broken. Any other way of doing this in v8 ?

อวตาร
ละทิ้ง

You can use the on_change function which will call automatically the function you need at the moment you click on a specific field. I can give you an example if you need.

ผู้เขียน

I'm afraid the on_change function is not called after a database query. My question is not related to views and clicks.

ผู้เขียน คำตอบที่ดีที่สุด

The solution is trivial : just call the compute method of the fields needed to be refreshed. Sorry for this one.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ส.ค. 15
3446
7
ก.ย. 20
7311
2
มิ.ย. 18
16576
1
พ.ย. 17
3971
0
พ.ย. 16
3980