Odoo Help

0

Refresh only one field with ajax on normal form view.

By
Nhomar Hernandez
on 9/13/14, 2:31 PM 1,693 views

Hello.

 

Situation:

I have a new model with a one2many field and one set of buttons which write other fields and other model.

When I click on the buttons they do the job without any problem, but the computed fields are not updated, what I need is (without use onchange due to I am on readonly mode) that the computed fields are refreshed without reload all view, there is a correct technique to achieve that.??

 

regards.

0
Nhomar Hernandez
On 9/14/14, 4:04 PM

We have the option:

"{'reload_on_button': true}"

For one2many fields, it supose works fine for my purpose, but the code have a comment telling it is a dirty hack.

./web/static/src/js/view_form.js:4773

If somebody can extend this explanation it should be cool.

 

It's difficult to understand your use case with this small description, but it seems to match more or less the situation that lead to the creation of the `reload_on_button` option, so I guess you could use it as long as it works. The new API should take care of updating your computed fields automatically in the future

Olivier Dony (odo)
on 9/16/14, 5:37 AM

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 9/13/14, 2:31 PM
Seen: 1693 times
Last updated: 3/16/15, 8:10 AM