Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
12426 Vizualizări

 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

Imagine profil
Abandonează
Cel mai bun răspuns

You should add in the __manifest__.py file

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

Thanks

Imagine profil
Abandonează
Autor

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

Cel mai bun răspuns

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

Imagine profil
Abandonează
Autor

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

Related Posts Răspunsuri Vizualizări Activitate
1
sept. 20
4818
0
iul. 20
4770
0
nov. 23
1893
1
iul. 23
2155
1
iun. 23
6149