Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3857 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

The solution is to add first : @api.multi

And at the end : return res

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 3 16
5394
1
thg 3 16
5116
4
thg 3 24
3663
1
thg 10 23
5560
1
thg 6 22
6859