Odoo Help


How to create a wizard sequence?

on 8/25/14, 5:12 AM 1,834 views

Hello everyone,

Here i want to create a wizard for adding  new users,

in my 1st wizard step,

enter some fields such as name, user_login, email, password

my 2nd wizard step,

select access rihts groups to this user by using many2many relations

here is my code.

in res_users.py

class res_users(osv.osv):

    _name = 'res.users'
    _description = 'Creating new user'
    _columns = {
        'name': fields.char('Name'),
        'user_login': fields.char('Login'),
        'mail': fields.char('Mail'),
        'password': fields.char('Password'),

class access_rights_wizard(osv.TransientModel):

    _name = 'access.righs.wizard'
    _description = 'Give access rights for this user'
    _columns = {
        'groups_id': fields.many2many('res.groups', 'res_groups_users_rel', 'uid', 'gid', 'Groups'),

in my res_users_view.xml

    <!-- Access Rights Wizard Start form view-->

        <record id="access_rights_form_view" model="ir.ui.view">
            <field name="name">Give access Rights</field>
            <field name="model">access.righs.wizard</field>
            <field name="arch" type="xml">
                <form string="Access Rights">
                    <field name="groups_id"/>
                 <button string="Save Rights" type="object" name="action_next" class="oe_link"/>

    <!-- Access Rights Wizard form view End -->      

    <!-- Access rights Wizard Action Start -->

        <act_window id="change_password_wizard_action"
            name="Change Password"
            view_type="form" view_mode="form"
            key2="client_action_multi" target="new"/>

    <!-- Access rights Wizard Action Start -->

    <!-- User Creation Wizard Form view Start -->

        <record id="view_users_simple_form" model="ir.ui.view">
            <field name="name">res.users.simplified.form</field>
            <field name="model">res.users</field>
            <field name="priority">1</field>
            <field name="arch" type="xml">
                <form string="Users" version="7.0">
                        <field name="name"/>
                        <field name="user_login"/>
                        <field name="mail"/>
                        <field name="password"/>
                 <button string="Change Password" type="action" name="%(change_password_wizard_action)d" class="oe_link"/>

    <!-- User Creation Wizard Form view end -->

    <!-- User Creation Wizard Action Start -->

        <record id="action_res_users" model="ir.actions.act_window">
            <field name="name">Users</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">res.users</field>
            <field name="view_type">form</field>
            <field name="target">new</field>            
            <field name="view_id" ref="view_users_simple_form"/>

    <!-- User Creation Wizard Action end -->

        <menuitem action="action_res_users" id="menu_action_res_users" parent="base.menu_users"/>                

Please correct my code.

Thanks in advance...


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: 8/25/14, 5:12 AM
Seen: 1834 times
Last updated: 3/16/15, 8:10 AM