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:
my_module
|__ 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,
}print_wizard()
my_module_wizard.xml (in the main folder with the __openerp__.py and __init__.py)
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<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">
<newline/>
<field name="dummy"/>
<newline/>
</xpath>
</field>
</record>
</data>
</openerp>
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.
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!