This commit is contained in:
gsinghpal
2026-02-25 09:40:41 -05:00
parent 0e1aebe60b
commit e71bc503f9
69 changed files with 7537 additions and 82 deletions

View File

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_move_form_poynt_button" model="ir.ui.view">
<field name="name">account.move.form.poynt.button</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="priority">60</field>
<field name="arch" type="xml">
<!-- Poynt Refund smart button on invoices -->
<xpath expr="//div[@name='button_box']" position="inside">
<button name="action_view_poynt_refunds"
type="object"
class="oe_stat_button"
icon="fa-undo"
invisible="poynt_refund_count == 0">
<field name="poynt_refund_count" widget="statinfo" string="Poynt Refunds"/>
</button>
</xpath>
<!-- Collect payment button on invoices -->
<xpath expr="//button[@id='account_invoice_payment_btn']" position="after">
<button name="action_open_poynt_payment_wizard"
string="Collect Poynt Payment"
type="object"
class="btn-secondary"
icon="fa-credit-card"
invisible="state != 'posted' or payment_state not in ('not_paid', 'partial') or move_type != 'out_invoice'"
groups="account.group_account_invoice"
data-hotkey="p"/>
</xpath>
<!-- Refund via Poynt button on credit notes -->
<xpath expr="//button[@id='account_invoice_payment_btn']" position="after">
<button name="action_open_poynt_refund_wizard"
string="Refund via Poynt"
type="object"
class="btn-secondary"
icon="fa-undo"
invisible="state != 'posted' or payment_state not in ('not_paid', 'partial') or move_type != 'out_refund' or poynt_refunded"
groups="account.group_account_invoice"
data-hotkey="r"/>
</xpath>
<!-- Resend Receipt button on invoices (paid via Poynt) -->
<xpath expr="//button[@id='account_invoice_payment_btn']" position="after">
<button name="action_resend_poynt_receipt"
string="Resend Receipt"
type="object"
class="btn-secondary"
icon="fa-envelope"
invisible="state != 'posted' or move_type != 'out_invoice' or not has_poynt_receipt"
groups="account.group_account_invoice"/>
</xpath>
<!-- Resend Receipt button on credit notes (refunded via Poynt) -->
<xpath expr="//button[@id='account_invoice_payment_btn']" position="after">
<button name="action_resend_poynt_receipt"
string="Resend Refund Receipt"
type="object"
class="btn-secondary"
icon="fa-envelope"
invisible="state != 'posted' or move_type != 'out_refund' or not poynt_refunded"
groups="account.group_account_invoice"/>
</xpath>
<!-- Refunded banner on credit notes -->
<xpath expr="//header" position="before">
<div class="alert alert-info text-center mb-0"
role="status"
invisible="not poynt_refunded">
<strong>Refunded via Poynt</strong> — This credit note has been
refunded to the customer's card through Poynt.
</div>
<field name="poynt_refunded" invisible="1"/>
<field name="has_poynt_receipt" invisible="1"/>
</xpath>
</field>
</record>
</odoo>