Odoo Help


How to add a field to a wizard?

Juan Formoso
on 6/23/14, 8:01 AM 2,113 views

I am trying to add a field (only a checkbox) to a wizard. I managed to do exactly this with other form, but it was not a wizard. But I repeated the same steps (obviously changing the respective names and variables) and I cannot see my field in the wizard. I inherited the original wizard as I did with the form which worked, but I do not know if I am doing something stupid, because I have just arrived to OpenERP a few time ago.

The structure of my module is:

|__ wizard
|   |__ __init__.py
|   |__ wizard_print.py
|__ __init__.py
|__ __openerp__.py
|__ my_module_wizard.xml

And my two important files are:

wizard_print.py (in a folder called wizard which has its respective __init__.py too)

from osv import fields, osv

class print_wizard(osv.osv_memory):

    _name = 'my.module.print.wizard'
    _inherit = 'original.module.print.wizard'
    _columns = {
        'dummy': fields.boolean('My dummy'),
    _defaults = {
         'dummy': True,


my_module_wizard.xml (in the main folder with the __openerp__.py and __init__.py)

<?xml version="1.0" encoding="utf-8"?>
        <record model="ir.ui.view" id="wizard_my_module_print">
            <field name="name">my.module.print.wizard.form</field>
            <field name="model">my.module.print.wizard</field>
            <field name="inherit_id" ref="original_module.wizard_original_module_print"/>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <xpath expr="/form/field[@name='original_variable']" position="after">
                    <field name="dummy"/>

Is this structure right? Should it work or is there any mistake I do not know?

Thank you @René Schuster! I removed both: _name from the python declaration and from the XML view. But it does not work yet.

Juan Formoso
on 6/23/14, 10:40 AM

Ok I did not have to delete the field in the XML view! In the XML view I had to change the content of the tag : replace my.module.print.wizard by original.module.print.wizard. I had understood you wrong!

Juan Formoso
on 6/23/14, 12:22 PM

René Schuster

--René Schuster--
| 5 5 8
Weinheim, Germany
--René Schuster--

Challenge Everything!

René Schuster
On 6/23/14, 8:16 AM

If you inherit from an existing model and set a different _name value, an new model will be created.

I think that is not quite what you want.

Change the _name value to "original.module.print.wizard" (in the python declaration and the xml view).

For more information see the Technical Mementos section on different inheritance mechanisms: https://www.odoo.com/files/memento/OpenERP_Technical_Memento_latest.pdf

Or this: http://stackoverflow.com/questions/21111627/inheritance-of-customized-module-in-openerp



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: 6/23/14, 8:01 AM
Seen: 2113 times
Last updated: 3/16/15, 8:10 AM