When you create a new folder within the models directory and add an init.py file in that new folder, you should import the new models within the init.py file of the new subdirectory, not in the init.py file of the main models directory. The same principle applies to XML files in the manifest.py file.
When you create a new folder within the models directory and add an init.py file in that new folder, you should import the new models within the init.py file of the new subdirectory, not in the init.py file of the main models directory. The same principle applies to XML files in the manifest.py file.
Example Structure: my_module/ ├── init.py ├── models/ │ ├── init.py │ ├── new_folder/ │ │ ├── init.py │ │ └── new_model.py │ └── existing_model.py ├── views/ │ └── view_file.xml └── manifest.py
In models/new_folder/init.py: from . import new_model
In models/init.py: from . import existing_model from . import new_folder
In manifest.py: 'data': [ 'views/view_file.xml', 'views/new_folder/view_file.xml', ],
This ensures proper organization and separation of your models and XML files within the module.