Hi, i want to click on a form button i created, call a function for that object and then open new view with the lines of that object modified by the function. I am not quite sure of how to do that, here's my code xml code:
<record id="view_best_rutas_form" model="ir.ui.view">
<field name="name">best.route</field>
<field name="model">best.route</field>
<field name="priority">1</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Mejores Rutas" version="7.0">
<header>
<button name="show_best_route" string="Ver Mejor Ruta" class="oe_highlight"/>
</header>
<field name="id" string="Id"/>
<field name="name" string="Nombre"/>
<field name="invoices" string="Facturas para Enviar" widget="one2many" colspan="4" nolabel="1">
<tree editable="bottom">
<field name="inv_id" domain="[('has_route','=',False), ('has_destination','=',True)]"/>
</tree>
</field>
<field name="fleets" string="Flotas" widget="one2many" colspan="4" nolabel="1">
<tree editable="bottom">
<field name="fleet_id"/>
</tree>
</field>
</form>
</field>
</record>
Currently i am calling to a function in my model, but i don't know how to open a view derived from that. I want to show the field invoices of that same best.route but with the changes i made in the function.