Hello!
I want to make changes in an existing test from another custom module without modifying files there. Is there is any way how to do it?
Thanks.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello!
I want to make changes in an existing test from another custom module without modifying files there. Is there is any way how to do it?
Thanks.
Yes we can modify existing test files with help of inheriting class and overwrite/override existing method.
Ex:If i want to alter one of test cases in sale module then i will create test file in my custom module and then inherit that class with help of import that class.
from odoo.addons.sale.tests.test_sale_order import TestSaleOrder
@tagged('post_install', '-at_install')
class TestSaleOrderExtended(TestSaleOrder):
//now simply write your logic here
//You can call super to call main code and add your existing code OR you can overwrite method with your own logic
Hope it will Help
Thanks
Thanks
If I do not want the super class function to be executed at all , I try to override with out calling super class method but unfortunately the super class function still executed . any solution ?
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
2
thg 10 23
|
2561 | ||
|
0
thg 9 21
|
3786 | ||
|
0
thg 10 20
|
2634 | ||
|
1
thg 4 23
|
1932 | ||
|
0
thg 6 22
|
2574 |