Skip to content

Commit a283a9a

Browse files
committed
[ADD] pos_pay: add pay functionality to POS ticket screen
Point of sale users were not able to pay from ticket screen which was quite frustrating for them. pos_pay app enables users to pay from ticket screen directly. this commit improves pos by: - add instant pay button to pos ticket screen. - direct load orders and pay from ticket screen - mobile responsive button. task - POS Improvements
1 parent 2849909 commit a283a9a

3 files changed

Lines changed: 66 additions & 0 deletions

File tree

pos_pay/__manifest__.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# -*- coding: utf-8 -*-
2+
{
3+
"name": "Instant Pay",
4+
"summary": """
5+
Pay directly from Ticked Screen
6+
""",
7+
"description": """
8+
Pay directly from Ticked Screen
9+
""",
10+
"author": "Odoo",
11+
"website": "https://www.odoo.com/",
12+
"category": "Tutorials",
13+
"version": "0.1",
14+
"application": True,
15+
"installable": True,
16+
"depends": ["base", "point_of_sale"],
17+
"data": [],
18+
"assets": {
19+
"point_of_sale._assets_pos": [
20+
"pos_pay/static/src/app/screens/ticket_screen.js",
21+
"pos_pay/static/src/app/screens/ticket_screen.xml",
22+
],
23+
},
24+
"license": "AGPL-3",
25+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { patch } from "@web/core/utils/patch";
2+
import { TicketScreen } from "@point_of_sale/app/screens/ticket_screen/ticket_screen";
3+
4+
patch(TicketScreen.prototype, {
5+
payFromTicketScreen() {
6+
const selectedOrder = this.getSelectedOrder();
7+
if (!selectedOrder) {
8+
this.env.services.notification.add("No order selected");
9+
return;
10+
}
11+
this.setOrder(selectedOrder);
12+
this.pos.pay();
13+
},
14+
});
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<templates id="template" xml:space="preserve">
4+
<t
5+
t-name="pos_pay.TicketScreen"
6+
t-inherit="point_of_sale.TicketScreen"
7+
t-inherit-mode="extension"
8+
>
9+
<xpath expr="//div[@t-else and hasclass('pads')]" position="inside">
10+
<button class="button validation load-order-button w-100 btn btn-lg btn-primary py-3"
11+
t-att-disabled="!_selectedSyncedOrder"
12+
t-on-click="() => this.payFromTicketScreen()">
13+
<div class="text-">Instant Pay</div>
14+
</button>
15+
</xpath>
16+
17+
<xpath expr="//div[hasclass('switchpane')]" position="inside">
18+
<button
19+
class="btn-switchpane load-order-button primary btn btn-primary btn-lg lh-lg w-50 py-3"
20+
t-att-disabled="!_selectedSyncedOrder"
21+
t-if="!isOrderSynced"
22+
t-on-click="() => this.payFromTicketScreen()">
23+
<div>Pay</div>
24+
</button>
25+
</xpath>
26+
</t>
27+
</templates>

0 commit comments

Comments
 (0)