Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3881 Widoki

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

Awatar
Odrzuć
Autor Najlepsza odpowiedź

The solution is to add first : @api.multi

And at the end : return res

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
4
mar 16
5435
1
mar 16
5137
4
mar 24
3701
1
paź 23
5598
1
cze 22
6882