summaryrefslogtreecommitdiff
path: root/addons/payment/views/account_invoice_views.xml
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/payment/views/account_invoice_views.xml
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/payment/views/account_invoice_views.xml')
-rw-r--r--addons/payment/views/account_invoice_views.xml28
1 files changed, 28 insertions, 0 deletions
diff --git a/addons/payment/views/account_invoice_views.xml b/addons/payment/views/account_invoice_views.xml
new file mode 100644
index 00000000..8e57cda0
--- /dev/null
+++ b/addons/payment/views/account_invoice_views.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<odoo>
+ <data>
+ <record id="account_invoice_view_form_inherit_payment" model="ir.ui.view">
+ <field name="name">account.move.view.form.inherit.payment</field>
+ <field name="model">account.move</field>
+ <field name="inherit_id" ref="account.view_move_form"/>
+ <field name="arch" type="xml">
+ <!--
+ The user must capture/void the authorized transactions before registering a new payment.
+ -->
+ <xpath expr="//button[@id='account_invoice_payment_btn']" position="attributes">
+ <attribute name="attrs">{'invisible': ['|', '|', '|', ('state', '!=', 'posted'), ('payment_state', 'not in', ('partial', 'not_paid')), ('move_type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt')), ('authorized_transaction_ids', '!=', [])]}</attribute>
+ </xpath>
+ <xpath expr="//button[@id='account_invoice_payment_btn']" position="after">
+ <field name="authorized_transaction_ids" invisible="1"/>
+ <button name="payment_action_capture" type="object"
+ string="Capture Transaction" class="oe_highlight"
+ attrs="{'invisible': ['|', '|', ('move_type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund')), ('state', '!=', 'posted'), ('authorized_transaction_ids', '=', [])]}"/>
+ <button name="payment_action_void" type="object"
+ string="Void Transaction"
+ confirm="Are you sure you want to void the authorized transaction? This action can't be undone."
+ attrs="{'invisible': ['|', '|', ('move_type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund')), ('state', '!=', 'posted'), ('authorized_transaction_ids', '=', [])]}"/>
+ </xpath>
+ </field>
+ </record>
+ </data>
+</odoo>