Creating a module in OpenERP is a very
simple process. All modules are located in addons folder
To create a module go to Server--> OpenERP--> Addons then right click on addons and create a new folder with the name of
your module..
Follow these simple steps:
- create '__init.py__' file which helps to load the class.
- The '__openerp__.py' file which is needed to load the module
- The '.py' file in which you will be able to create class methods and all the programming.
- '.xml file' – In this you will create the view of the module, you can define fields menu and front view of module.
- The __init__.py file in this init file you have to import all .py file which is used in that particular module.
Example :
import demo
__openerp__.py file
This OpenERP file has the following values:
depends: List of modules on which this module depends.
The base module must always be added in the dependencies because some necessary
data for the views, reports,..are included in the base module.
init : List of .xml files to load when the server is
launched with the "--init=module" argument. File paths must be
relative to the directory where the module is. OpenERP XML File Format is detailed
in this section.
data : List of .xml files to load when the server is
launched with the "--update=module" launched. File paths must be
relative to the directory where the module is. OpenERP XML File Format is
detailed in this section.
demo : List of .xml files to provide demo data. File
paths must be relative to the directory where the module is. OpenERP XML File
Format is detailed in this section.
active : True or False (default: False). Determines the
modules that are installed on the database creation.
The XML file :-
In this , we create the view of the
module and we can also customize it.
There are 4 sections..
1. Creating the view i.e. form,tree,kanban and graph
- Defining the fields
- Creating the action for menu
- Creating the menu item.
How to install module on server:-
First open the terminal and go to the server directory and type the
command.
Syntax: . /openerp-server -u [module_name] -d [database name]
For Example: ./openerp-server -u
demo_module -d demo
Then open the server on the browser using
your local host and in the setting section, you can search the module in the
search box and install it.
So have fun and start making your own
modules....
Thanks