Good day!
Is there a way to add a button above the Tree View in Odoo?
I would like to run a function whenever the User Clicks the button.
If this is not possible can you help me with an alternative?
here is my code on view:
'''<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="account_payment_import_view_tree" model="ir.ui.view">
<field name="name">account.payment.import.view.tree</field>
<field name="model">account.payment.import</field>
<field name="arch" type="xml">
<tree string="Payment Imports" decoration-info="payment_id != False" decoration-danger="error_msg != False">
<field name="transaction_date"/>
<field name="facts_id"/>
<field name="paid_in_lei"/>
<field name="paid_in_euro"/>
<field name="amount"/>
<field name="account"/>
<field name="account_no"/>
<field name="document_no"/>
<field name="details_bk_statement"/>
<field name="error_msg"/>
<field name="invoice_number" invisible="1"/>
<field name="payment_id" widget="many2onebutton" invisible="1"/>
<field name="invoice_id" widget="many2onebutton" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="currency_id" invisible="1"/>
</tree>
</field>
</record>
<record id="account_payment_import_action" model="ir.actions.act_window">
<field name="name">Payment Imports</field>
<field name="res_model">account.payment.import</field>
<field name="view_mode">tree</field>
<field name="domain">[]</field>
<field name="context">{'edit': 0}</field>
</record>
<menuitem
id="account_payment_import_menu"
name="Payment Imports"
action="account_payment_import_action"
parent="account.menu_finance_receivables"
sequence="160"/>
</odoo>'''