Skip to content

Commit ff1245d

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 ff1245d

3 files changed

Lines changed: 65 additions & 0 deletions

File tree

pos_pay/__manifest__.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "Instant Pay",
3+
"summary": """
4+
Pay directly from Ticked Screen
5+
""",
6+
"description": """
7+
Pay directly from Ticked Screen
8+
""",
9+
"author": "Odoo",
10+
"website": "https://www.odoo.com/",
11+
"category": "Tutorials",
12+
"version": "0.1",
13+
"application": True,
14+
"installable": True,
15+
"depends": ["base", "point_of_sale"],
16+
"data": [],
17+
"assets": {
18+
"point_of_sale._assets_pos": [
19+
"pos_pay/static/src/app/screens/ticket_screen.js",
20+
"pos_pay/static/src/app/screens/ticket_screen.xml",
21+
],
22+
},
23+
"license": "AGPL-3",
24+
}
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)