refactor: refine XPath selectors to separately target non-cash payment overview rows and input fields in closing popup

This commit is contained in:
Suherdy Yacob 2026-05-13 08:09:39 +07:00
parent 3d9be58a77
commit 2cbd87b9b1

View File

@ -12,23 +12,27 @@
<attribute name="t-if">pos.config.module_pos_hr and !pos.config.custom_hide_payment_details</attribute>
</xpath>
<!-- 2. Hide Non Cash Input Fields -->
<!-- We use t-att-class to hide them if the setting is on -->
<xpath expr="//div[@t-foreach='props.non_cash_payment_methods']" position="attributes">
<!-- 2. Hide Non Cash Overview Rows -->
<xpath expr="//div[hasclass('payment-methods-overview')]//div[@t-foreach='props.non_cash_payment_methods']" position="attributes">
<attribute name="t-att-class">pos.config.custom_hide_non_cash_inputs ? 'd-none' : 'w-100 mb-3'</attribute>
</xpath>
<!-- 3. Hide Cash In/Out -->
<!-- 3. Hide Non Cash Input Fields -->
<xpath expr="//div[@t-foreach='props.non_cash_payment_methods' and .//Input]" position="attributes">
<attribute name="t-att-class">pos.config.custom_hide_non_cash_inputs ? 'd-none' : 'w-100 mb-3'</attribute>
</xpath>
<!-- 4. Hide Cash In/Out -->
<xpath expr="//button[contains(@t-on-click, 'this.cashMove()')]" position="attributes">
<attribute name="t-if">pos.showCashMoveButton and !pos.config.custom_hide_cash_in_out</attribute>
</xpath>
<!-- 4. Hide Summary Data -->
<!-- 5. Hide Summary Data -->
<xpath expr="//div[hasclass('total-orders')]" position="attributes">
<attribute name="t-if">!pos.config.custom_hide_summary_data</attribute>
</xpath>
<!-- 5. Hide Copy Buttons -->
<!-- 6. Hide Copy Buttons -->
<!-- Cash count autofill -->
<xpath expr="//button[@t-on-click='autoFillCashCount']" position="attributes">
<attribute name="t-if">!pos.config.custom_hide_copy_btn</attribute>
@ -38,7 +42,7 @@
<attribute name="t-if">!pos.config.custom_hide_copy_btn</attribute>
</xpath>
<!-- 6. Hide Daily Sale Button -->
<!-- 7. Hide Daily Sale Button -->
<xpath expr="//button[@t-on-click='downloadSalesReport']" position="attributes">
<attribute name="t-if">!pos.config.custom_hide_daily_sale_btn</attribute>
</xpath>