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

[9.0] Why my "make_po" method is runned 3 times ?

By
Totor
on 3/30/16, 2:57 AM 275 views

Hi, I inherit of my make_po method to do its core functionalities and in addition the call of my new method "transitAccountAnalytic"

But "make_po" is runned 3 times and I don't know why.


This is my class from procurement.py :

class procurement_order(models.Model):

_inherit = 'procurement.order'

def make_po(self):

print "=== make_po ==="

self.transitAccountAnalytic()

def transitAccountAnalytic(self):

print "=== transitAccountAnalytic ==="

procurement_order()

Thanks

0
Totor
On 3/30/16, 7:02 AM

The solution is to add first : @api.multi

And at the end : return res

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: 3/30/16, 2:57 AM
Seen: 275 times
Last updated: 3/30/16, 7:02 AM