feat: restrict order management actions by hiding Done, Reset, and Clear All buttons in KDS interface

This commit is contained in:
Suherdy Yacob 2026-06-08 21:00:20 +07:00
parent b9f376a221
commit bf343df752
3 changed files with 22 additions and 0 deletions

View File

@ -21,6 +21,7 @@ and todo status of previously processed prep order lines.
'pos_preparation_display.assets': [ 'pos_preparation_display.assets': [
'pos_kds_fix/static/src/app/components/orderline/orderline_patch.js', 'pos_kds_fix/static/src/app/components/orderline/orderline_patch.js',
'pos_kds_fix/static/src/app/components/order/order_patch.js', 'pos_kds_fix/static/src/app/components/order/order_patch.js',
'pos_kds_fix/static/src/app/components/order/order_patch.xml',
'pos_kds_fix/static/src/app/components/preparation_display/preparation_display_patch.js', 'pos_kds_fix/static/src/app/components/preparation_display/preparation_display_patch.js',
'pos_kds_fix/static/src/app/components/preparation_display/preparation_display_patch.xml', 'pos_kds_fix/static/src/app/components/preparation_display/preparation_display_patch.xml',
], ],

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-inherit="pos_enterprise.Order" t-inherit-mode="extension" owl="1">
<!-- Hide "Done" button on each card -->
<xpath expr="//button[@t-on-click.stop='doneOrder']" position="replace"/>
<!-- Style "Reset" button to span full width by removing border-end -->
<xpath expr="//button[@t-on-click.stop='() => this.prepDisplay.changeStateStage(this.props.order.states)']" position="attributes">
<attribute name="class">btn btn-lg btn-secondary flex-grow-1 rounded</attribute>
</xpath>
</t>
</templates>

View File

@ -35,5 +35,14 @@
</button> </button>
</div> </div>
</xpath> </xpath>
<!-- Hide Top Right "Done" buttons (in burger menu and desktop topbar) -->
<xpath expr="//button[@t-on-click='() => this.archiveAllVisibleOrders()']" position="replace"/>
<xpath expr="//button[@t-on-click='() => this.prepDisplay.resetOrders()']" position="replace"/>
<xpath expr="//li[@t-on-click='() => this.archiveAllVisibleOrders()']" position="replace"/>
<xpath expr="//li[@t-on-click='() => this.prepDisplay.resetOrders()']" position="replace"/>
<!-- Hide "Clear All Orders" button -->
<xpath expr="//div[@t-on-click='() => this.prepDisplay.clearAllOrders()']" position="replace"/>
</t> </t>
</templates> </templates>