再会!
有没有办法在 Odoo 的树视图上方添加一个按钮?
每当用户单击按钮时,我想运行一个函数。
如果这是不可能的,你能帮我提供替代方案吗?
这是我的代码:
'''<?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> …Run Code Online (Sandbox Code Playgroud)