Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
4759 Ansichten

Could anybody tell if it's possible to open wizard inside another wizard?

I tried to do that but when I'm trying to open the second wizard I'm getting warning message, 'cause the first wizard is tring to submit the form information. 

Avatar
Verwerfen
Beste Antwort

Hi, you can write your code to open another wizard from a wizard like this:

In xml:

<record id="product_wizard" model="ir.ui.view">
        <field name="name">first.wizard.form</field>
        <field name="type">form</field>
        <field name="model">sample.wizard</field>
        <field name="arch" type="xml">
            <form string="---------" version="7.0">
             ------------------------

            -------------------------

<button name="second_wizard" colspan="1" string="Go to Second Wizard" type="object"  context="{'default_id':active_id,---------}"/>
             
            </form>
        </field>
    </record>


        <record model="ir.actions.act_window" id="action_add_package_product_form">
            <field name="name">First Wizard</field>
            <field name="res_model">sample.wizard</field>
            <field name="view_type">form</field>
            <field name="view_mode">form</field>
            <field name="view_id" ref="product_wizard" />
            <field name="context">{........}</field>
            <field name="target">new</field>
        </record>

In py file:

    def second_wizard(self, cr, uid, ids, context):
  --------------------

   --------------
        return {
            'name': "Second Wizard " ,
            'view_type': 'form',
            'view_mode': 'form',
            'view_id': False,
            'res_model': 'second.wizard',
            'src_model': 'first.wizard',
            'type': 'ir.actions.act_window',
            'context': context,
            'target': 'new',
        }

( Note : Like the first.wizard, you should create the second.wizard in both py and xml )

Avatar
Verwerfen