Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
3 Vastaukset
5094 Näkymät

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 ?

Avatar
Hylkää

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.

Tekijä

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

Tekijä Paras vastaus

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

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
elok. 15
3433
7
syysk. 20
7307
2
kesäk. 18
16564
1
marrask. 17
3954
0
marrask. 16
3970