Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
12499 Переглядів

 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
4846
0
лип. 20
4811
0
лист. 23
1954
1
лип. 23
2184
1
черв. 23
6186