I need a button in the view redirect to a website view, but nothing happens when the button is clicked, I checked the button with a raise Warning and it works, but never redirects
xml:
<record id="quotation_details_tree" model="ir.ui.view"> <field name="name">Detalle de cotizaciones</field> <field name="model">insurance.quotation_detail</field> <field name="arch" type="xml"> <tree string="Detalles Cotizaciones"> <field name="coverage" /> <field name="payment_method" /> <field name="price" /> <field name="fee_amount" /> <field name="company_id" /> <button class="btn btn-primary btn-sm" type="object" name="issue_policy" string="Emitir" /> </tree> </field> </record>
and python code in the quotation detail model:
def issue_policy(self): return { 'type': 'ir.actions.act_url', 'name': "Emitir póliza", 'url': 'seguro/issue_policy/', 'target': 'self',
'context': self,
}
The qweb page it is working, I can access it through the url.
What is the problem?
Version Odoo 13.0