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

I'm building a custom module where I'll only be using account.invoices data. So when creating the module, on the manifest I would set its dependencies like 

'depends': ['account']

or should I use 

'depends': ['base','account']

Which one would be the best practice?
What would be the difference?

I'm working on Odoo11

Thanks in advance.

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

Hi Jean,

I think  you just need to use the first one, i.e,

'depends': ['account']


According to Odoo documentation, the field 'depends' in the manifest file is used to load all the modules required for the working of the current one. So before installing your module, all of its dependencies will be installed. 


In your case, since you need to use account invoices data, you just need to use  "'depends': ['account']".
So this will be the procedure, when you try to install your module, Odoo will first try to install all the dependencies for your module. In this case, it is 'account' module. Now, this process will be repeated for the 'account" module now. That is, Odoo will try to install 'account' module and its dependencies. 


Your module will be installed once all the dependent modules are installed. Hopefully, 'base' module will be there in the dependencies list. So what I'm saying is, in your case, it is not needed for you to load 'base' directly using the second method, i.e,

'depends': ['base','account'].
It will be something like repeating the same process multiple times.

Thanks

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 5 20
2274
3
thg 12 19
4377
6
thg 12 23
19009
1
thg 3 15
3803
5
thg 5 19
2801