Dear all,
Happy new year for all of you.
I am using Odoo 12 and have a form view with a button that executes a specific code.
Now, I need to close the form view and open the tree view after the code is executed.
What I have:
On the model:
@api.multi
def button_click(self, vals):
#some code here
On the xml (form view):
<record id="myform_view_id" model="ir.ui.view">
<field name="name">mymodel.myform.name</field>
<field name="model">mymodel</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form>
<header>
<button string="Click Here" name="button_click" type="object" class="oe_highlight"/>
</header>
<!-- FORM DATA GOES HERE -->
</form>
</field>
</record>
How can I close this form view and open the same model tree view (already defined) after user click on the "button_click"?
Thank you all in advance
Best regards
PM
try this: https://goo.gl/Baw9Zt