Skip to content

[ADD] pos_ticket_payment: add payment button on TicketScreen #902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: 18.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions pos_ticket_payment/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "POS Ticket Payment",
"summary": "Enable direct payment from the ticket screen in POS",
"description": """
POS Ticket Payment
==================

This module enhances the Point of Sale interface by allowing users to initiate payment directly from the ticket (order) screen.

Key Features:
-------------
- Adds a "Payment" button next to the "Load" button on the ticket screen.
- Clicking "Payment" will load the selected order and navigate to the payment screen.
- Speeds up the checkout process for saved orders.

Ideal for fast-paced retail environments where quick payment access is essential.
""",
"license": "AGPL-3",
"application": True,
"installable": True,
"depends": ["point_of_sale"],
"author": "Dhruvrajsinh Zala (zadh)",
"version": "0.1",
"assets": {
"point_of_sale._assets_pos": [
"pos_ticket_payment/static/src/app/**/*"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { TicketScreen } from '@point_of_sale/app/screens/ticket_screen/ticket_screen';
import { patch } from '@web/core/utils/patch';

patch(TicketScreen.prototype, {
async onPayClick() {
this.pos.set_order(this.getSelectedOrder());
this.pos.pay();
},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="pos_ticket_payment.PaymentButton" t-inherit="point_of_sale.TicketScreen" t-inherit-mode="extension">
<xpath expr="//div[@t-if='ui.isSmall']//button[hasclass('load-order-button')]" position="after">
<button class="button btn-primary pay-order-button btn btn-lg w-50" t-on-click="onPayClick">Payment</button>
</xpath>
<xpath expr="//div[@t-else='']//button[hasclass('load-order-button')]" position="after">
<button class="button btn-primary pay-order-button btn btn-lg w-100" t-on-click="onPayClick">Payment</button>
</xpath>
</t>
</templates>