feat: disable basic receipt button when order is empty or contains unsent items

This commit is contained in:
Suherdy Yacob 2026-06-01 22:26:26 +07:00
parent d4e2f04cdf
commit 3fda7467a4

View File

@ -6,9 +6,11 @@
<attribute name="t-if">this.pos.cashier.pos_role != 'waiter'</attribute>
</xpath>
<xpath expr="//button[hasclass('pay-order-button')]" position="after">
<!-- Disabled when order is empty or has unsent items (not yet sent/saved) -->
<button t-if="(this.pos.cashier.pos_role == 'waiter' or this.pos.cashier.pos_role == 'cashier') and this.pos.config.basic_receipt"
class="button btn btn-secondary btn-lg py-3 d-flex align-items-center justify-content-center flex-fill"
t-att-class="{'col-3': showFastPaymentMethods}"
t-att-disabled="currentOrder.isEmpty() or this.pos.getOrderChanges().nbrOfChanges"
t-on-click="() => this.pos.printReceipt({ order: this.currentOrder, basic: true, printBillActionTriggered: true })">
<i class="fa fa-print me-2"/> Basic Receipt
</button>