Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Error installing Custom module

João Bernardo
on 6/19/14, 11:40 AM 824 views

I followed a tutorial on how to create a module (https://doc.openerp.com/trunk/web/module/) but i am getting a lot of errors.

Errors: http://pastebin.com/rBpg9uuf

Basically, i copied and pasted every bit of code i've seen in that tutorial (While reading, obviously)

__openerp__.py : http://pastebin.com/xY9tcBuW

__init__.py : http://pastebin.com/3J73Y9r7


I am using OpenERP 7.





Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 6/19/14, 11:54 AM


Please provide the xml file here.

The error sayas that, the xml file line 11 contains menuitem tag which breaks the xml validation.

You might see your terminal which will show you the xml file record with exact description of error.

If not, please share your xml file here so one can help you get rid of the error.


João Bernardo
On 6/19/14, 12:06 PM

Fixed the error.


Don't know hwy, but i had some random menu tags on my xml file. Thanks for pointing that!



--Odoo --
| 5 2 5
kerala, India
--Odoo --

Working as a Odoo Functional and Technical Expert

On 6/20/14, 2:11 AM


Here I explain how to create a basic module in openerp .please follow the foldr structure of modules 



import barcode_info




'name':'Barcode Generator',
'update_xml' : ['barcode_view.xml'
'description':'Barcode Geneartor Module',



from osv import osv,fields

class barcode_info(osv.osv):
             'barcode_id':fields.integer('Product code'),
             'barcode_ref':fields.integer('Reference #'),
    def button_generate(self,cr,uid,ids,context=None):
        print " put your code here "
        return True



<?xml version="1.0" encoding="utf-8"?>
        <record id="barcode_info_tree" model="ir.ui.view">
                <field name="name">barcode.information</field>
                <field name="model">barcode.info</field>
                <field name="arch" type="xml">
                    <tree string="Barcode">                                    
                        <field name="barcode_id"/>                
                        <field name="barcode_ref"/>
                        <field name="barcode_price"/>
                        <field name="barcode_name"/>
                <record id="barcode_info_form" model="ir.ui.view">
                <field name="name">barcode.information</field>
                <field name="model">barcode.info</field>
                <field name="arch" type="xml">
                    <form string="Barcode Information">                                    
                        <field name="barcode_id"/>                
                        <field name="barcode_ref"/>
                        <field name="barcode_price"/>
                        <field name="barcode_name"/>

                            <button name="button_generate" string="Generate"
                         class="oe_highlight" type="object"/>    
        <record id="barcode_id_action" model="ir.actions.act_window">
        <field name="name">Barcode Geneartor</field>
        <field name="res_model">barcode.info</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form</field>
        <menuitem id="menu_barcode_main" name="Barcode" />
        <menuitem id="menu_barcode_sub" name="Barcode Generation" parent="menu_barcode_main"/>
        <menuitem id="menu_barcode_sub1" name="Generate" parent="menu_barcode_sub" action="barcode_id_action"/>




Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 6/19/14, 11:40 AM
Seen: 824 times
Last updated: 3/16/15, 8:10 AM