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

 Hi,
Can anyone explain how we can  add a module dependency by code. Foe example i have a module 'test_module', now it have only one dependency 'base_setup'. After install this module i need to add a depend module 'sale_management' to my module (in some action). Also it should follow the basic dependency feature, ie when i uninstall the 'sale_management' my 'test_module' also need to get uninstalled.

Thanks

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

You should add in the __manifest__.py file

depends:['base_setup','sale_management'],

Thanks

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

Please read the question carefully i need to add the dependency by code, not from manifest, after the installation of module.

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

you should add module dependency in the manifest file (__menifest__.py).

depends: ['base_setup', 'sale_management']

ref: https://www.odoo.com/documentation/13.0/reference/module.html

Note: for an older version of odoo, it was __openerp__.py

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

Please read the question carefully i need to add the dependency by code, not from manifest, after the installation of module.

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ย. 20
4826
0
ก.ค. 20
4782
0
พ.ย. 23
1901
1
ก.ค. 23
2158
1
มิ.ย. 23
6161