Odoo Hilfe

0

0
2 Answers
1
DIlip Shyani
24.08.17, 01:15

Hello Kristian,

You have mention name="create" ,  so you have to create "create method" in .py file of your wizard ,

tou have to write code inside that create method.


you have to write below code in form tags.

 <footer>

                        <button string="Save" class="oe_highlight"

                            name="create" type="object" />

                        or

                        <button string="Cancel" class="oe_highlight" special="cancel" />

        </footer>

0

<button string="Save" name="create" type="object"/>
▲▲▲That peace of code is ok. ▲▲▲

But you have to add the create function on your python code, just like if you want to overwrite it.

  • If you want to excecute more code before or after the create use this code:
    ####################
    @api.model
    def create(self, values):

             #Code before create
             record = super(your_model, self).create(values)
             #Code after create
             return record
    ####################

  • If you just want to execute the create function:
    ####################
    @api.model
    def create(self, values):

             return super(your_model, self).create(values)
    ####################



Fragen Sie
Writer
Keep Informed
1 Verfolger
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