Initial Setup for Custom Module path

There is three way to have the OpenERP recognize the custom create module.
  1. Using custom config file
  2. Specified in command

Initial Setup: Using Custom config file

Following step include how to created custom config file and allow server to recognize the custom config file. The custom config file will contain the necessary configuration to allow OpenERP to recognize the Custom module path.

  1. Copy the config file from the installed OpenERP path to a specific folder (e.g. "/etc" folder)
    • sudo cp openerp7/install/openerp-server.conf /etc/
  2. Change config file permission to allow OpenERP to read the conf file
    • sudo chmod 640 /etc/openerp-server.conf
    • sudo chown <super username> /etc/openerp-server.conf
  3. Edit custom conf file (/etc/openerp-server.conf), using a custom module path name /home/openerp/training_module as example. Please note that the path must be full path
    • addons_path = /home/openerp/training_module,/home/openerp/openerp7/openerp/addons

Example trigger command for the conf file name as openerp-server.conf that location at /etc folder
  • ./openerp-server -c /etc/openerp-server.conf

Initial Setup: Using Custom config file

Following command can be use to tell OpenERP where the custom module path is. The example show the command which the the custom module path is at /home/openerp/training_module
  • ./openerp-server --addons=/home/openerp/training_module

Creating custom module

Now you can start developing your custom module in the specified custom module path (e.g. /home/openerp/training_module). Following step will allow the module show in the OpenERP.
  1. Create another folder for the custom module. (e.g. /home/openerp/training_module/college)
  2. Under the created folder add the following files, do note that first and second item is a combine double under-scroll ( _ _is __)
    • _ _ openerp _
      • Contain module configuration
    • _ _ init _
      • Entry point for the module
    • <module's model name>.py
      • Main code for the data structure
    • <module's view name>.xml
      • Main code for the display view
  3. Open OpenERP and login to desire database
  4. Change admin setting to enable Technical Features
    1. Go to "Settings" tap, under "Users" --> "Users", select "Admin"
    2. Click on "Access Rights" and edit it
    3. Make sure the "Technical Features" is check and save.
  5. New menu name as "Update Modules List" will be appear under "Modules" section, click on it and perform update
  6. Under "Installed Modules", remove the "Installed" filter and search for the custom module.
    • Do note that the custom module can only found under "Installed Modules" menu and not "Apps" menu

Executing the custom module

To Execute the custom module we can use the following command

./openerp-server -c <custom config file> -d <created database> -u <module name to be updated>

Following are the extra options and explanation.
  • -c <name and path of the config file>
  • -u <name of the module>
    • explain: update and then run the openerp instance>
  • -d <database name>