تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
6294 أدوات العرض

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?

الصورة الرمزية
إهمال
أفضل إجابة

Did you figure out how to do this?

الصورة الرمزية
إهمال
أفضل إجابة

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.


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
مايو 25
1477
1
سبتمبر 17
5070
2
ديسمبر 22
12988
1
ديسمبر 22
4369
2
نوفمبر 24
4170