Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
12443 Visualizzazioni

 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

Avatar
Abbandona
Risposta migliore

You should add in the __manifest__.py file

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

Thanks

Avatar
Abbandona
Autore

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

Risposta migliore

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

Avatar
Abbandona
Autore

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

Post correlati Risposte Visualizzazioni Attività
1
set 20
4823
0
lug 20
4778
0
nov 23
1900
1
lug 23
2158
1
giu 23
6154