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>

View File

@@ -24,6 +24,7 @@
<div class="o_row" col="2">
<field name="poynt_webhook_secret" password="True"/>
</div>
<field name="poynt_default_terminal_id"/>
</group>
</group>
<group name="provider_credentials" position="after">

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="payment_transaction_form_inherit_poynt" model="ir.ui.view">
<field name="name">payment.transaction.form.inherit.poynt</field>
<field name="model">payment.transaction</field>
<field name="inherit_id" ref="payment.payment_transaction_form"/>
<field name="arch" type="xml">
<!-- Voided banner at top of form -->
<xpath expr="//header" position="before">
<div class="alert alert-warning text-center mb-0"
role="alert"
invisible="not poynt_voided">
<strong>VOIDED</strong> — This transaction was voided on Poynt
on <field name="poynt_void_date" widget="datetime" readonly="1" class="d-inline"/>.
The payment has been reversed before settlement.
</div>
</xpath>
<!-- Void button in header -->
<xpath expr="//header/button[@name='action_void']" position="after">
<button string="Void Transaction"
name="action_poynt_void"
type="object"
class="btn-secondary"
invisible="state != 'done' or provider_code != 'poynt'"
confirm="Are you sure you want to void this transaction? This reverses the payment before settlement and cannot be undone. Only works same-day before closeout (6 PM)."/>
</xpath>
<!-- Add voided fields to the form sheet -->
<xpath expr="//field[@name='provider_reference']" position="after">
<field name="poynt_voided" invisible="1"/>
<field name="poynt_void_date" invisible="not poynt_voided"/>
</xpath>
</field>
</record>
</odoo>

View File

@@ -100,11 +100,11 @@
</field>
</record>
<!-- Menu entry under Payment Providers -->
<!-- Menu entry as sibling of Payment Providers under Online Payments -->
<menuitem id="menu_poynt_terminal"
name="Poynt Terminals"
parent="account_payment.payment_provider_menu"
parent="account.root_payment_menu"
action="action_poynt_terminal"
sequence="30"/>
sequence="15"/>
</odoo>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_order_form_poynt_button" model="ir.ui.view">
<field name="name">sale.order.form.poynt.button</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="priority">60</field>
<field name="arch" type="xml">
<xpath expr="//button[@id='create_invoice']" position="after">
<button name="action_poynt_collect_payment"
string="Collect Payment"
type="object"
class="btn-secondary"
icon="fa-credit-card"
invisible="state not in ('sale', 'done')"
data-hotkey="p"/>
</xpath>
</field>
</record>
</odoo>