feat: update POS role permissions to include cashiers for basic receipts and restrict opening register for waiters

This commit is contained in:
Suherdy Yacob 2026-05-18 11:11:04 +07:00
parent a0018e2572
commit 14938a00e1
2 changed files with 10 additions and 1 deletions

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<!-- Restrict Open Register button in OpeningControlPopup to exclude Waiter role -->
<t t-name="pos_employee_role.OpeningControlPopup" t-inherit="point_of_sale.OpeningControlPopup" t-inherit-mode="extension">
<xpath expr="//button[hasclass('btn-primary')]" position="attributes">
<attribute name="t-if">!(this.pos.cashier._role === 'minimal') and this.pos.cashier.pos_role != 'waiter'</attribute>
</xpath>
</t>
</templates>

View File

@ -6,7 +6,7 @@
<attribute name="t-if">this.pos.cashier.pos_role != 'waiter'</attribute> <attribute name="t-if">this.pos.cashier.pos_role != 'waiter'</attribute>
</xpath> </xpath>
<xpath expr="//button[hasclass('pay-order-button')]" position="after"> <xpath expr="//button[hasclass('pay-order-button')]" position="after">
<button t-if="this.pos.cashier.pos_role == 'waiter' and this.pos.config.basic_receipt" <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" 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-class="{'col-3': showFastPaymentMethods}"
t-on-click="() => this.pos.printReceipt({ order: this.currentOrder, basic: true })"> t-on-click="() => this.pos.printReceipt({ order: this.currentOrder, basic: true })">