Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Odoo8 trigger compute methods

By
Emanuel Cino
on 8/4/15, 5:42 AM 544 views

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.

Drees Far
on 8/4/15, 5:59 AM

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

Emanuel Cino
on 8/4/15, 6:05 AM
0
Emanuel Cino
On 8/4/15, 7:20 AM

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 8/4/15, 5:42 AM
Seen: 544 times
Last updated: 8/4/15, 7:20 AM