Odoo Help


Custom Module Issue - Add Field to Event Registration Module

on 3/12/13, 3:45 AM 3,484 views


I created a custom module to add a field to the Event Registration Form, I need a text field where we can input more details for each registered user to an X event.

So far I have develop the following module:

  • add_fields_events (folder)
  • __init__.py
  • __openerp__.py
  • code.py
  • view.xml

Each one with the following simple code:


import code


    'name' : 'Custom Extra Event Fields',
    'version' : '1.0',
    'description' : """Custom Extra Fields for Event Module""",
    'depends' : ['event'],
    'init_xml' : [], 
    'update_xml' : ['view.xml'],
    'demo_xml' : [],
    'active' : False, 
    'installable' : True,


from osv import osv, fields

class res_partner_add_text_field(osv.osv):
    _inherit = 'event.registration'

    _columns = {
        'textual_field' : fields.text('Details'),


<?xml version="1.0" encoding="UTF-8"?>
        <record model="ir.ui.view" id="view_event_form_add_text_field">
            <field name="name">view.event.form.add.text.field</field>
            <field name="model">event.registration</field>
            <field name="inherit_id" ref="view_event_registration_form"/>
            <field name="arch" type="xml">
                <field name="email" position="after">
                    <field name="textual_field" />

Everything seems to be alright, but i get the following error when trying to install:

ValueError: No such external ID currently defined in the system: add_event_fields.view_event_registration_form

Any ideas? The "view_event_registration_form" is the id inside of event_view.xml - View which i would like to change.

Thanks in advance!

On 3/12/13, 4:15 AM

Seems i got the solution.

Reading and watching from other examples I realize that in OpenERP, you have to inherit from the same (folder - file) "structure" that is in the addons folder, so based on that the right parameter in code.py is:

class res_partner_add_text_field(osv.osv):
    _inherit = 'event.event'

In the other hand in the view.xml the "event." property must be included as part of the refence, so the right code would be:

<field name="inherit_id" ref="event.view_event_registration_form"/>

So there you go, my initial experience with custom modules.

Do you have any other advice? Thanks!

No advice for you but your post was instructive to me as I am also a newbie with custom modules. Thanks for the helpful examples!

on 3/12/13, 9:57 AM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 3/12/13, 3:45 AM
Seen: 3484 times
Last updated: 3/7/17, 5:03 AM