Odoo Help

Welcome!

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.

0

Error installing Custom module

By
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.

Thanks

 

 

1

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 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

Joao,

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.

Thanks.

0
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!

0

Odoo

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

Working as a Odoo Functional and Technical Expert

Odoo
On 6/20/14, 2:11 AM

Hi,

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

 

init.py----------------------

import barcode_info

 

opeenrp.py----------------------

 

{
'name':'Barcode Generator',
'version':'0.0',
'author':'Libu',
'depends':['base'],
'update_xml' : ['barcode_view.xml'
                                ],
'installable':True,
'category':'General',
'description':'Barcode Geneartor Module',
'website':'',
'demo':[]
}

 

barcode_info.py-----------------

from osv import osv,fields


class barcode_info(osv.osv):
   
    _name='barcode.info'
    
    _columns={
            
             'barcode_id':fields.integer('Product code'),
             'barcode_ref':fields.integer('Reference #'),
             'barcode_price':fields.integer('weight/price'),
             'barcode_name':fields.integer('Barcode'),
             }
       
    def button_generate(self,cr,uid,ids,context=None):
        print " put your code here "
        return True
    
barcode_info()

 

barcode_view.xml----------------------

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        
        <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"/>
                        
                    </tree>
                </field>                
        </record>
    
        
                <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"/>    
                             
                             </form>
                         
                     
                </field>                
        </record>
        
        
        <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>
    </record>
        
        
        
        <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"/>
        

                                </data>
        
            </openerp>

 

 

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)

Stats

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