تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
5109 أدوات العرض

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.

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
أغسطس 15
3446
7
سبتمبر 20
7309
2
يونيو 18
16574
1
نوفمبر 17
3966
0
نوفمبر 16
3979