Skip to content
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
15 changes: 15 additions & 0 deletions pos_improvements/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "POS - Improvements",
"version": "1.0",
"description": "Enable direct payment from the ticket screen in POS",
"author": "Ravij Parikh (snrav)",
"application": True,
"depends": ["point_of_sale"],
"license": "LGPL-3",
"assets": {
"point_of_sale.assets_prod": [
"pos_improvements/static/src/pos_ticket_screen/js/pos_ticket_screen.js",
"pos_improvements/static/src/pos_ticket_screen/xml/pos_ticket_screen.xml"
],
}
}
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.setOrder(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-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>