refactor: replace nbrOfChanges check with currentOrder.hasChange for consistency in Actionpad and ProductScreen buttons

This commit is contained in:
Suherdy Yacob 2026-06-20 12:17:27 +07:00
parent 8eff7cd492
commit 4eee31a769

View File

@ -3,7 +3,7 @@
<t t-name="pos_custom_access.ActionpadWidget" t-inherit="point_of_sale.ActionpadWidget" t-inherit-mode="extension">
<xpath expr="//button[hasclass('pay-order-button')]" position="attributes">
<attribute name="t-if">pos.canPay</attribute>
<attribute name="t-att-disabled">this.pos.getOrderChanges().nbrOfChanges &gt; 0</attribute>
<attribute name="t-att-disabled">currentOrder.hasChange</attribute>
</xpath>
<xpath expr="//button[hasclass('set-table')]" position="replace">
<!-- Hidden "Set Table" button on Register order -->
@ -14,7 +14,7 @@
<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 &gt; 0"
t-att-disabled="currentOrder.isEmpty() or currentOrder.hasChange"
t-on-click="() => this.pos.printReceipt({ order: this.currentOrder, basic: true, printBillActionTriggered: true })">
<i class="fa fa-print me-2"/> Table Checker
</button>
@ -24,7 +24,7 @@
<t t-name="pos_custom_access.ProductScreen" t-inherit="point_of_sale.ProductScreen" t-inherit-mode="extension">
<xpath expr="//button[hasclass('pay-button')]" position="attributes">
<attribute name="t-if">!pos.scanning and pos.canPay</attribute>
<attribute name="t-att-disabled">this.pos.getOrderChanges().nbrOfChanges &gt; 0</attribute>
<attribute name="t-att-disabled">currentOrder.hasChange</attribute>
</xpath>
</t>
</templates>