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

I am trying to structure my code and I just want to sort my models into different subfolders, however I can't get it to work

This is what my structure looks like

The custom and the inherits folder both have their own __init__.py

This is what the models/__init__.py looks like

and in the subfolders __init__ .py, I import them like this:

But upon starting I keep getting the error

AssertionError: Invalid import of it should start with 'odoo.addons'.addons.rectanglemaps.models.the model

I have already tried to import them with odoo.addons but that just produces another error


It can't be that hard right? How to structure the python code?

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

Hi,

Try follow the below structure.


And the __init__.py looks like,


Try refer the following article to see complete module structure

https://odooforum.cybrosys.com/glossary/coding-standards-16/odoo-module-structure-overview-13

Regards

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 11 23
1277
1
thg 11 22
3748
2
thg 3 24
4639
0
thg 10 22
2839
Open a URL Đã xử lý
2
thg 10 22
7027