Odoo Module Generator is a Tkinter-based GUI application designed to facilitate the creation of Odoo modules. This application allows users to define module information, add models and fields, and generate the necessary files and structure for an Odoo module.
- User-friendly interface to create Odoo modules.
- Define module information (name, version, category, summary, dependencies).
- Add multiple models with fields to the module.
- Automatically generate the necessary files (
__init__.py
,__manifest__.py
, model files, views, and security files). - Review and confirm module details before generation.
- Python 3.6 or higher.
- Tkinter (usually included with Python).
-
Clone the repository:
git clone https://github.com/dmunoz2019/OdooModuleGenerator.git cd OdooModuleGenerator
-
Create a virtual environment and activate it:
python -m venv myenv source myenv/bin/activate # On Windows use `myenv\Scripts\activate`
-
Install dependencies (if any):
pip install -r requirements.txt
-
Run the application:
python app.py
-
Follow the steps in the GUI to create your Odoo module:
- Click Start to begin.
- Enter module information (name, version, category, summary, dependencies).
- Add models and their respective fields.
- Review and confirm the module details.
- Generate the module.
app.py
: Main application file containing the Tkinter GUI.odoo_generator.py
: Contains classes for generating the Odoo module files and structure.tests/test_app.py
: Unit tests for the application.
This file defines the Tkinter GUI application. Key classes include:
ModuleGeneratorApp
: Main application class.MainMenu
: Frame for the main menu.ModuleInfo
: Frame for entering module information.ModelInfo
: Frame for adding models and fields.Review
: Frame for reviewing and confirming module details.Result
: Frame displaying the result of the module generation.Help
: Frame providing help/documentation.
This file contains classes for generating the various files needed for an Odoo module:
DirectoryManager
: Creates the directory structure for the module.FileManager
: Writes content to files.InitFileBuilder
: Generates__init__.py
files.ManifestBuilder
: Generates__manifest__.py
.ModelBuilder
: Generates model files.ViewBuilder
: Generates view XML files.SecurityBuilder
: Generates security access CSV files.OdooModuleGenerator
: Orchestrates the module generation process.
Contains unit tests for the Tkinter application using the unittest
module. Tests include:
- Initial state of the application.
- Navigation between frames.
- Entering module information.
- Adding models and fields.
- Generating the module.
To run the tests, use:
pytest tests/test_app.py
Contributions are welcome! Please fork the repository and submit pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
For any questions or suggestions, please contact [[email protected]].