Hi, in my case i want to create a button inside tree view header to call an existing wizard. my source code is working, but i need to select some record to show my custom button. did missing something or this is a wrong way to create custom button on tree view header?
tree_view.xml
<record id="view_bank_account_tree"model="ir.ui.view">
<field name="name">bank.account.treefield>
<field name="model">account.journalfield>
<field name="type">treefield>
<field name="arch"type="xml">
<tree create='0'string="Bank Account">
<header>
<button name="show_wizard"type="object"string="Create"class="oe_highlight"/>
header>
<field name="name"/>
<field name="bank_id"/>
<field name="bank_bic"/>
tree>
field>
record>
model.py
from odoo import models, fields, api
class bank_account(models.Model):
_inherit='account.journal'
bank_bic=fields.Char(string='Bank Identifier Code', related='bank_id.bic')
def show_wizard(self):
return {
'name' : 'Add a Bank Account',
'type' : 'ir.actions.act_window',
'res_model' : 'account.setup.bank.manual.config',
'views' : [[False, 'form']],
'target' : 'new'
}