From 22b3a507cfca7803505e5fec9f2d9163a356e713 Mon Sep 17 00:00:00 2001 From: zadh-odoo Date: Wed, 30 Jul 2025 18:32:41 +0530 Subject: [PATCH] [ADD] pos_ticket_payment: add payment button on TicketScreen Before: Users had to manually: 1. Click the "Load Order" button to load a ticket. 2. Then click the "Payment" button to proceed to the PaymentScreen. This made the payment flow slower and more manual. After: - Introduced a new "Payment" button beside the "Load Order" button on the TicketScreen. - On click, it directly loads the selected order and opens the PaymentScreen. Impact: Reduces steps in the cashier workflow by allowing users to immediately proceed to payment with a single click from the TicketScreen. Task:[4982532] --- pos_ticket_payment/__manifest__.py | 29 +++++++++++++++++++ .../screens/ticket_screen/ticket_screen.js | 9 ++++++ .../screens/ticket_screen/ticket_screen.xml | 11 +++++++ 3 files changed, 49 insertions(+) create mode 100644 pos_ticket_payment/__manifest__.py create mode 100644 pos_ticket_payment/static/src/app/screens/ticket_screen/ticket_screen.js create mode 100644 pos_ticket_payment/static/src/app/screens/ticket_screen/ticket_screen.xml diff --git a/pos_ticket_payment/__manifest__.py b/pos_ticket_payment/__manifest__.py new file mode 100644 index 00000000000..32681ae704b --- /dev/null +++ b/pos_ticket_payment/__manifest__.py @@ -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/**/*" + ] + } +} diff --git a/pos_ticket_payment/static/src/app/screens/ticket_screen/ticket_screen.js b/pos_ticket_payment/static/src/app/screens/ticket_screen/ticket_screen.js new file mode 100644 index 00000000000..8f0c0a67ef7 --- /dev/null +++ b/pos_ticket_payment/static/src/app/screens/ticket_screen/ticket_screen.js @@ -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(); + }, +}); diff --git a/pos_ticket_payment/static/src/app/screens/ticket_screen/ticket_screen.xml b/pos_ticket_payment/static/src/app/screens/ticket_screen/ticket_screen.xml new file mode 100644 index 00000000000..62473a40acb --- /dev/null +++ b/pos_ticket_payment/static/src/app/screens/ticket_screen/ticket_screen.xml @@ -0,0 +1,11 @@ + + + + + + + + + + +