Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
3754 มุมมอง

Hi,

I would like to override testcases of odoo sales module. Is that possible?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

yes, it's possible. 
Inherit the standard test class and override the test case(method) you want to modify. 

อวตาร
ละทิ้ง
ผู้เขียน

Can you possibly give me an example? Thanks!

https://github.com/odoo/odoo/blob/12.0/addons/sale/tests/test_sale_transaction.py#L11

like this, you can inherit any test class and override its method

ผู้เขียน

Thank you! Unfortunately this is not working as expected, because the 'old' code is still executed and throws erros.

คำตอบที่ดีที่สุด

rather than override, what you want is inherit the test and modify part of his code from an external module?

อวตาร
ละทิ้ง