Monday, 9 January 2012

OpenERP Custom Module Development

OpenERP Custom Module Development

Courtesy :- ibcscorp


This article will explain the basic steps involved in developing custom OpenERP modules. It is a “Hello World” kind of guideline, therefore you won’t be able to find out all the theories behind OpenObject platform here. Instead you will get all the necessary information to get started with.
Sample module given here is fully functional and tested on OpenERP version 6.0.2 (with Web Client on Chrome browser). You will be able to download the complete source code at the end of this article.

Module Description

The sample module we are going to develop is a simple Notebook application. It helps to take down notes and contains just three fields namely “Title”, “Note” and “Date” in its data model.

Module Structure

An OpenERP module consists of some basic elements as explained below. Note that what is explained here is only the basic files required and structure will be more complex in real world applications.
  • – contains the application logic and database table structure definition.
  • – init script will load the application’s main python-module and related in application initialization.
  • view_name.xml – contains the application interface definition and menu structure.
  • – is the module descriptor file. In previous versions of OpenERP this was known as “”.

File Contents

Even though there is no specific order, I am going to start with the main python class (module) of our OpenERP module. This will handle the core functionality of the module and also will generate the database table to store related data.

[ ]

from osv import fields, osv
import time

class notebook(osv.osv):
 _name = "notebook"
 _description = "Simple Notebook"
 _columns = {
  'title' : fields.char('Title', size=30, required=True),
  'note' : fields.text('Note'),
  'note_date' :'Date'),

Next we import the python module we created in application initialization script.

[ ]

import notebook
After that we define the view and menu structure of our module.

[ notebook_view.xml ]

<?xml version="1.0" encoding="utf-8"?>
        <record model="ir.ui.view" id="notebook_tree_view">
            <field name="name">notebook.tree</field>
            <field name="model">notebook</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Notebook">
                    <field name="title"/>
                    <field name="note"/>
                    <field name="note_date"/>

        <record model="ir.ui.view" id="notebook_form_view">
            <field name="name">notebook.form</field>
            <field name="model">notebook</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Notebook">
                    <field name="title"/>
                    <field name="note"/>
                    <field name="note_date"/>

        <record model="ir.actions.act_window" id="action_notebook_form">
            <field name="name">notebook</field>
            <field name="res_model">notebook</field>

        <menuitem name="Notebook" icon="terp-project" id="notebook_menu"/>

        <menuitem name="Notes" parent="notebook_menu" id="notebook_menu_mainform" action="action_notebook_form"/>
Finally create the application descriptor as follows.

[ ]

 "name" : "notebook",
 "version" : "0.1",
 "author" : "Serpent Consulting Services",
 "website" : "",
 "category" : "Generic Modules/Others",
 "depends" : ["base"],
 "description" : "Simple demo module",
 "init_xml" : ["notebook_view.xml"],
 "demo_xml" : [],
 "update_xml" : [],
 "active": False,
 "installable": True

Packaging and Installing New Module

To prepare your module for installation, following the given path below.
1. Login to OpenERP admin view and open “Update Modules List” screen under “Modules” section in “Administration” area. Click “Update” button. And then close the form.
Note: Sometimes on OpenERP V6, the message ”Loading..” will be continuously displayed, even though your module is successfully updated. In that case simply close the message window and continue to next step.

2. After updating modules list, it will appear under OpenERP “Modules” list. It can be easily located by Searching for the module name. Once you found the module, mark it for installation, then select the check box in front of the module and click “Apply Scheduled Upgrades” link.

Click on “Start update” to continue the installation.

Accessing Your Module

After installing your module successfully, it will appear on the home screen of your OpenERP client as follows.

The sample source code explained above is available here.


Motivation behind preparing this article was the difficulty I have faced in finding out a proper start up guide in custom OpenERP module development. Even official documentation appeared to be incomplete/inconsistent at the moment of writing this article.

Anyway there is a lot more to explore in OpenERP module development. As an OpenERP partner, Binary Quest is always willing to help you in your OpenERP implementation project. If you found this post useful just leave a comment and do not hesitate to contact us on any OpenERP related issue.


  1. Thanks for this guide, it was refreshingly clear (I also found the openERP documentation to be very unclear and inconsistent).

    I would also add that if the Update Module List button is not visible in version 6.1, enabling the "Extended View" in your user settings will make that visible.


    1. Tag: PM203A56. Let me share all of you about #5 Tips for Project Management Success,, I hope you enjoy it

      1. Plan your day using time management techniques

      As a project manager, time management skills are essential because you are dealing with a wide range of tasks that demand a quick turnaround time. Planning your day will go a long way in keeping you organized and increasing your productivity. Assist your task planning by using project management software which helps you track the work of you and your team.

      If you are not very tech savvy, a simple to-do list can also be a great organizational tool. Prioritize your most important tasks by putting them at the top of the list and less important ones at the bottom. Having a visual plan of your daily tasks helps to keep you on track and aware of time.

      Related post: Free ebook 104 secrets to become a great project manager

      2. Include stakeholders in important project conversations

      While you will have plenty of responsibilities regarding the project, don’t neglect your clients.

      Good communication is essential is keeping both parties informed of project progression, curtailing scope creep, and apprised of changing requirements. Some clients may have different expectations when it comes to communication, so make sure to establish the frequency and type of communication (like emails, phone calls, and face-to-face conversations) at the beginning of your project.

      Establishing communication expectations early helps alleviate stakeholder uncertainty about communication frequency and delivery.

      3. Regularly communicate with your team

      Daily team communication helps keep misunderstandings and unclear requirements under control. Keeping your team informed in every step of the project is essential to project management success.

      For example, a study published by Procedia Technology found that good communication skills were the cornerstone of project management. The study examined over 300 “construction project managers, architects, construction managers, engineers and quantity surveyors” and their successes and failures on various construction projects.

      4. Anticipate project setbacks

      Even the best-laid plans often go awry.

      Remember that even with a high amount of planning and attention to detail, your project may still encounter some challenges. Pay attention to complaints from stakeholders or colleagues, and other warning signs, like a missed deadline or cost overrun, that there may be a problem.

      Preventing a crisis will keep your project running smoothly, save you a lot of time, and keep you, your team, and your stakeholders confident in progressing with the project.

      Unfortunately not every complication can be avoided. Crisis management skills are essential for dealing with the unexpected. Project managers need to be flexible and pragmatic. Improvise and make sharp decisions when needed.

      Related post: 92 free project management templates

      5. Stay focused on the details

      A common problem project managers encounter is having the project aims not aligned with the organization’s objectives. A great project manager will strategize a plan for the project to lead back to the overall success of the business.

      Know your project’s scope by heart and avoid wandering outside of the project’s requirements. It’s too easy to get lost in minor details and forget what your focus is, so a well-planned project scope is essential for success.

      And final, you should use KPI to measure effectiveness of the project, here are full list: 76 project management KPIs

  2. This comment has been removed by the author.

  3. Hi guys. Need your help , because mine still doesn't work .
    After creating notepad "module" , i moved it into /usr/share/pyshared/openerp/addons , but when i update the modules it doesn't show up ?

    Even after restarting the openerp server .

    ps: rights on notepad repertory is "drwxr-xr-x"


  4. Josue,
    Did you run update module list first?
    P.S. Please contact us on for quicker response.

  5. This comment has been removed by the author.

  6. Thanks for sharing this valuable info on OpenERP modules. Its good I found this blog by accident, and I am shocked why this accident did not happen earlier! I bookmarked it.

    sap implementation guide