Tower: upload laundry_management 19.0.19.0.4 (via marketplace)
This commit is contained in:
28
addons/laundry_management/static/src/js/order_tabs_patch.js
Normal file
28
addons/laundry_management/static/src/js/order_tabs_patch.js
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
/** @odoo-module
|
||||||
|
*
|
||||||
|
* OrderTabs patch — gate every tab-driven order switch and the "+" new
|
||||||
|
* order button through pos.confirmExitSettleIfNeeded so the cashier
|
||||||
|
* cannot silently leave a live settle-due order behind.
|
||||||
|
*
|
||||||
|
* Both methods stay async to align with their existing signatures.
|
||||||
|
*/
|
||||||
|
import { patch } from "@web/core/utils/patch";
|
||||||
|
import { OrderTabs } from "@point_of_sale/app/components/order_tabs/order_tabs";
|
||||||
|
|
||||||
|
patch(OrderTabs.prototype, {
|
||||||
|
async selectFloatingOrder(order) {
|
||||||
|
const allowed = await this.pos.confirmExitSettleIfNeeded(order);
|
||||||
|
if (!allowed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return super.selectFloatingOrder(order);
|
||||||
|
},
|
||||||
|
|
||||||
|
async newFloatingOrder() {
|
||||||
|
const allowed = await this.pos.confirmExitSettleIfNeeded(null);
|
||||||
|
if (!allowed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return super.newFloatingOrder();
|
||||||
|
},
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user