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

Is there a way to call a method from super of super (the grandparent class)?

I'm writing a module to show stock in more granular ways on the webshop.
So I would like to overwrite _cart_update() in website_sale_stock.sale_order (which inherits website_sale.sale_order), but also call _cart_update() from website_sale.sale_order.

Calling super(SaleOrder, self)._cart_update() in my model will call the method of website_sale_stock.sale_order, which is unnecessary. I do however need to get the return values from _cart_update() from website_sale.sale_order.

Is this at all possible, or do I have to live with Odoo executing some unnecessary code?

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

Did you figure out how to do this?

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

Have you figured out how to do it yet? I am having the same issue. I want to find a way to call the code of the grandparent class and not that of the parent class.


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 5 25
1275
1
thg 9 17
4920
2
thg 12 22
12810
1
thg 12 22
4185
2
thg 11 24
3958