Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
12440 Näkymät

 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
Hylkää
Paras vastaus

You should add in the __manifest__.py file

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

Thanks

Avatar
Hylkää
Tekijä

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

Paras vastaus

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
Hylkää
Tekijä

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

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
syysk. 20
4822
0
heinäk. 20
4777
0
marrask. 23
1898
1
heinäk. 23
2157
1
kesäk. 23
6154