Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
12434 Lượt xem

 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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

You should add in the __manifest__.py file

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

Thanks

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 9 20
4819
0
thg 7 20
4774
0
thg 11 23
1893
1
thg 7 23
2156
1
thg 6 23
6151