Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
12047 Weergaven

 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
Annuleer
Beste antwoord

You should add in the __manifest__.py file

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

Thanks

Avatar
Annuleer
Auteur

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

Beste antwoord

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
Annuleer
Auteur

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

Gerelateerde posts Antwoorden Weergaven Activiteit
1
sep. 20
4339
0
jul. 20
4527
0
nov. 23
1642
1
jul. 23
1855
1
jun. 23
5891