Odoo Help

0

How to run python function when editing a product

By
Matthieu
on 6/21/16, 6:57 AM 602 views

Hello,


I'm trying to run a python function when I click on "Save" in a product page but I don't know what is the function I have to inherit from product.product or product.template.


Please, help me ! Thank you in advance.

1

def create() if it is a new record

def write() if it is an existing record.


You can find nice informations in the documentation of odoo about the ORM : https://www.odoo.com/documentation/8.0/reference/orm.html


product.product if you are in a product variant view

product.template if you are on a product view.


You can find easily in the url the active_model.

0
Dilip Dabhi
On 6/21/16, 9:12 AM

When you click on "Save" button below two method you have to inherit...

def create(self, cr, uid, ids, context=None):

--

--

res = super(sale_order, self).create(cr, uid, ids, context=None)

--

--

return res


or


def write(self, cr, uid, ids,vals, context=None):

--

--

res = super(sale_order, self).create(cr, uid, ids, vals,context=None)

--

--

return res


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: 6/21/16, 6:57 AM
Seen: 602 times
Last updated: 6/21/16, 9:12 AM