Tower: upload laundry_management 19.0.19.0.4 (via marketplace)
This commit is contained in:
21
addons/laundry_management/static/src/js/navbar_patch.js
Normal file
21
addons/laundry_management/static/src/js/navbar_patch.js
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/** @odoo-module
|
||||||
|
*
|
||||||
|
* Navbar patch — gate the POS-logo "register" click so cashiers can't
|
||||||
|
* silently abandon a settle-due order by clicking back to the home/
|
||||||
|
* register screen.
|
||||||
|
*
|
||||||
|
* The original onClickRegister is sync; we make ours async and the
|
||||||
|
* existing OWL bindings still work (they fire-and-forget).
|
||||||
|
*/
|
||||||
|
import { patch } from "@web/core/utils/patch";
|
||||||
|
import { Navbar } from "@point_of_sale/app/components/navbar/navbar";
|
||||||
|
|
||||||
|
patch(Navbar.prototype, {
|
||||||
|
async onClickRegister() {
|
||||||
|
const allowed = await this.pos.confirmExitSettleIfNeeded(null);
|
||||||
|
if (!allowed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return super.onClickRegister();
|
||||||
|
},
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user