How to create a module in odoo12
Module structure
Our custom module must be inside a seperate folder,here life_insurance is our module name.And inside our folder contain
1- models
The model folder will contain our python files which are used in our custom module
2- security
The security folder will contain the files related to the security
3- views
The views folder will contain the XML files, which are used to define our custom modoule's view.
4- __init__.py
To import our python files which are used in this custom module
5- __manifest__.py
The manifest file serves to declare a python package as an odoo module and to specify module metadata
The __manifest__.py file contains
- Name : Name of the module to be displayed
- Version : Modules version
- Summary : Summary of the modoule
- Description : Extended description for the module
- Author : Name of the module author
- Website : Website of the company/personal
- Category : Category of the module
- Depends : Mention the modules depends our module,if nothing mention base only
- Data : Mention our XML files and CSV file here
__init__.py file
init files are used to import our python files,inside the init file in our life_insurance module will be contains
Inside our models folder it also contain __init__.py file.That contains
The model folder contains init file and python files.the init file will discussed above and our python file policy_details.py contains
The views folder contains
The insurance_management_view.xml file contains menus and sub menus of our model.
The policy_view.xml will contains our model's view and the action perform when press on the insurance menu.
After defining thet view the file should be added in data tag inside manifest file like this
The insurance_management_view.xml file contains menus and sub menus of our model.
After defining thet view the file should be added in data tag inside manifest file like this
The security folder will contain ir.model.access.csv. Here we can specify the security of the models in our module.Here we give permission for the users to read,write,create and unlink to the model 'policy.model'.
After created the CSV file,it will be add in our data tag inside manifest file like this
After complete this restart the service and on the Debug Mode
in Apps ->Update Apps List ->(Search our custom module in search field,after remove the Apps filter)->Update
After Install our module,the new menu will be shown
And the form view will be looks like
Wonderful Article!!!!
ReplyDeleteThank you so much for sharing your thoughts with us. It is very helpful and informational. Keep sharing. Odoo
I am very impressed with your post because this post is very beneficial for me and provide new knowledge to me
ReplyDeletePyCharm Crack
iTools Crack
Ad-Aware Pro Security Crack
iSkysoft iMedia Converter Deluxe Crack
Sketchbook Pro Crack