feat: implement automatic register unlock and maintain order screen focus after order submission

This commit is contained in:
Suherdy Yacob 2026-06-05 17:00:05 +07:00
parent 383bf63f19
commit c560cba1eb
4 changed files with 37 additions and 2 deletions

View File

@ -18,6 +18,8 @@ This Odoo 19 module enhances the security and auditability of the Point of Sale
- **UI Streamlining - Button Renaming**: Renames the "Basic Receipt" button to "Table Checker" (on both the action pad and print success screen) for clearer pre-payment table verification.
- **Automatic Table Checker on Send**: Automatically prints a "Table Checker" (Basic Receipt) whenever the employee clicks the kitchen "Send" button to submit changes.
- **Incremental Printing on Send**: When additional items are added to an already sent order, the automatic print on "Send" is filtered to print *only the newly added (additional) items*, preventing duplicate printing of already served items.
- **Unlock Register PIN/Selection Bypass**: Bypasses the PIN prompt and employee selection when unlocking/opening the register. It unlocks directly with the current/last cashier since actions (table selection, payment, loading order, register order) are already PIN-protected.
- **Stay on Current Order on Send**: Retains the POS UI on the current table/order screen after clicking "Send" rather than returning to the Floor Screen (table view).
## Dependencies

View File

@ -1,6 +1,6 @@
{
'name': 'POS Custom Employee Access',
'version': '19.0.0.0.2',
'version': '19.0.0.0.3',
'category': 'Point of Sale',
'summary': 'Enhanced POS access control and employee tracking',
'description': """
@ -12,6 +12,8 @@
- Hide "Transfer Course" button on POS UI
- Hide "Save Order for Later" (upload) button on POS UI
- Rename "Basic Receipt" to "Table Checker"
- Bypass PIN code and employee selection on Unlock Register
- Stay on the current order/table after clicking Send
""",
'author': 'Suherdy Yacob',
'depends': ['pos_restaurant', 'pos_hr', 'pos_employee_role'],

View File

@ -0,0 +1,24 @@
/** @odoo-module */
import { LoginScreen } from "@point_of_sale/app/screens/login_screen/login_screen";
import { patch } from "@web/core/utils/patch";
patch(LoginScreen.prototype, {
async openRegister() {
if (!this.pos.config.module_pos_hr) {
super.openRegister();
return;
}
const currentCashier = this.pos.getCashier();
if (currentCashier) {
this.cashierLogIn();
} else {
const allEmployees = this.pos.models["hr.employee"].getAll();
if (allEmployees.length) {
this.pos.setCashier(allEmployees[0]);
}
this.cashierLogIn();
}
}
});

View File

@ -180,7 +180,14 @@ patch(PosStore.prototype, {
}
}
const res = await super.submitOrder(...arguments);
const originalShowDefault = this.showDefault;
this.showDefault = () => {};
let res;
try {
res = await super.submitOrder(...arguments);
} finally {
this.showDefault = originalShowDefault;
}
if (order && this.config.basic_receipt) {
if (orderProxy) {