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

Update values on the fly based on user input, possible?

By
Yakito
on 2/27/15, 12:51 PM 495 views

Hi, 

I need to updates values of "Column B" based on "Column A" and an user input.

For that I would need to present the user with some kind of "Calculate" button and a wizard where the user will enter a desired % and then Column B values will appear.

I am not asking exactly how can I do this, right now I would like to know if this is possible? Where should I look at? How can I create a "calculate" button?

Any tip will be appreciated!

 

0
Yogesh
On 2/27/15, 1:08 PM

you can use @api.onchange('field_a')


    @api.onchange('field_a')
    def _onchange_field_a(self):
        if self.field_a:
            self.field_b = some_value_after_calculation

This method will be called whenever there is a change in value of field_a and will update value of field_b. No button is required.

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: 2/27/15, 12:51 PM
Seen: 495 times
Last updated: 3/16/15, 8:10 AM