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

Replace python function with custom module

By
M
on 2/22/16, 9:33 AM 334 views

I want to make a change to a python function in odoo-server/addons/website_sale/models/payment.py:

def form_feedback(self, cr, uid, data, acquirer_name, context=None):
     ** MY CODE **
     return res


How can I replace the function with my code in a custom module without changing in Odoo code itself (upgrade safe)?

not "replace" but "override" it, you'll need to *override* it from your module. Inherit the model, containint this function and in the inherited class you'll be able to do so. see documentation for inheritance

Temur
on 2/23/16, 5:51 AM

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/22/16, 9:33 AM
Seen: 334 times
Last updated: 2/22/16, 9:36 AM