feat: disable Print Bill button when there are unsent order changes

This commit is contained in:
Suherdy Yacob 2026-06-08 20:54:19 +07:00
parent a389ad963e
commit 6173399c87

View File

@ -12,4 +12,11 @@
<attribute name="t-attf-class">{{ currentOrder &amp;&amp; currentOrder.isEmpty() ? 'btn-secondary' : 'btn-primary' }}</attribute> <attribute name="t-attf-class">{{ currentOrder &amp;&amp; currentOrder.isEmpty() ? 'btn-secondary' : 'btn-primary' }}</attribute>
</xpath> </xpath>
</t> </t>
<t t-inherit="point_of_sale.ControlButtons" t-inherit-mode="extension" owl="1">
<!-- Disable Bill button if there are unsent changes -->
<xpath expr="//button[@t-on-click='clickPrintBill']" position="attributes">
<attribute name="t-att-disabled">!pos.getOrder()?.getOrderlines()?.length or pos.getOrderChanges().nbrOfChanges</attribute>
</xpath>
</t>
</templates> </templates>