Odoo Help


button inside the one2many field of wizard in odoo 9

Rakhi sudevan
on 9/27/16, 2:26 AM 350 views

when create one2many wizard with button , the button cannot able to click. Anyone explain.why?

Thanh Loyal
On 9/27/16, 10:25 PM

Assume that you have

class ClassA

    lines: fields.One2many('class.b', ....)

and class ClassB

     def action_do_something(self):


Now in the form view of class A, you add a new item. What happens? you see a new line of class B in the list but it is only in the browser, it does not exist on server yet. Your button is linked to action_do_something of a not yet exist object of class B. How can you call that function of a not exist object? You can't. You must save object of class A first, so that new object of class B get saved too (actually, it is created). Then you can call its method.

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


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)


Asked: 9/27/16, 2:26 AM
Seen: 350 times
Last updated: 9/27/16, 10:25 PM