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

Object button don't call method in python

By
Pedro Leite
on 2/8/16, 10:53 AM 492 views

Hi,


i'm trying to call a function in python with following buttons:

<form string="Settings" class="oe_form_configuration">
     <header>
         <button string="Apply" type="object" name="execute" class="oe_highlight"/>
         <button string="Cancel" type="object" name="cancel" class="oe_link"/>
    </header>
     ...
</form>

But, they will never be called. After some time, I saw that is just called the method of update, that is, def write(...).

Can someone help me understand the problem?


Best regards

0
Pedro Leite
On 2/9/16, 1:21 PM

Hi,


I solved this with:

@api.one
0
Samantha Cruz
On 2/8/16, 7:41 PM

Put the name first before the string

 <button name="execute" string"Apply" type="object" class="oe_highlight"/>

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/8/16, 10:53 AM
Seen: 492 times
Last updated: 2/9/16, 1:22 PM