Skip to Content
Menu
This question has been flagged
3 Replies
2922 Views

I want to open wizard on onchange method how it can be possible ? 

return is not working in onchange method



Regards

Avatar
Discard
Best Answer

Hi, you can follow following link for this:

https://youtu.be/oMnHpHH54QU

Thanks

Avatar
Discard
Best Answer

A workaround: add a button near the field, using button action to trigger the wizard

in xxx_model.py

def apply_template(self):
​self.ensure_one()
​return {'name': 'Are you sure?',
​'type': 'ir.actions.act_window',
​'res_model': 'quotation.template_apply_confirm_wizard',
​'view_mode': 'form',
​'view_type': 'form',
​'target': 'new',
​}

 

in xxx_views.xml 


Avatar
Discard

<xpath expr="//group[@name='order_details']" position="after">
<group name="quotation_template">
<label for="quotation_template_id"/>
<div class="o_row">
<field name="quotation_template_id" string="Template"/>
<button name="apply_template" string="Apply" type="object" icon="fa-bars"
attrs="{'invisible':[('quotation_template_id', '=', False)]}"
/>
</div>
</group>
</xpath>

Best Answer

Usman Farzand

only the following 3 things possible in onchange method:

Set Values in fields

Set Domain

Return warning message

You can not open a wizard using onchange.

I Hope this will help you. 

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Discard
Author

i already know this but i need to know way out how i can achive this.....
i need to open wizard on change any possiblity or alternative solution