Odoo Help


launch wizard in python

Voathnak Lim
on 5/16/13, 6:21 AM 5,246 views

I have a requirement, to launch a wizard in my python. could anyone help me please!

here is my view:

        <record id="my_config_view_form" model="ir.ui.view">
            <field name="name">my.item.config.view</field>
            <field name="model">my.model.config</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="base.res_config_view_base"/>
                <field name="arch" type="xml">

                    <group string="res_config_contents" position="replace">
                        <label colspan="4" align="0.0" string="
                            Configure this item by defining its field"/>
                        <field name="my_field"/>
                    <xpath expr="//button[@name='action_skip']"  position="attributes">
                        <attribute name="string">Proceed</attribute>
                        <attribute name="class">oe_highlight</attribute>
                    <xpath expr="//button[@name='action_next']" position="attributes">
                        <attribute name="string">Ok</attribute>
                        <attribute name="class">none</attribute>

        <record id="my_config_window" model="ir.actions.act_window">
            <field name="name">My config window</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">my.model.config</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="my_config_view_form"/>
            <field name="view_mode">form</field>
            <field name="target">new</field>

        <record id="my_config_step" model="ir.actions.todo">
            <field name="action_id" ref="my_config_window"/>

I wrote this code but the wizard is not not showing:

def onchange_test_wizard(self, cr, uid, ids, context=None):

        return {
            'name': 'test',
            'view_type': 'form',
            'view_mode': 'form',
            'view_id': 'my_config_view_form',
            'res_model': 'my.model.config',
            'domain': [],
            'context': context,
            'type': 'ir.actions.act_window',
            'target': 'new',

could anyone write a python code to launch this wizard? Please!

Voathnak Lim
on 5/16/13, 8:00 AM

Hi, you cannot return an action or view or wizard in an onchange function. You can find example of return view in python in account/account.py with function "execute" or "fiedls_view_get", but are used to override an existant function. Bye

Cyril Gaspard (GEM)
on 5/19/13, 11:29 AM

Hello, thank you for your answer. but what if I really want to return in in onchange function. how can i do?

Voathnak Lim
on 5/23/13, 7:30 AM

Hi, I repeat a second time, it is not possible to return a view in an onchange. Bye

Cyril Gaspard (GEM)
on 5/23/13, 7:37 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: 5/16/13, 6:21 AM
Seen: 5246 times
Last updated: 11/7/17, 12:30 AM