From bb7d9327eebc5a6aab54e78ff2d8b2d99d961ba7 Mon Sep 17 00:00:00 2001 From: Suherdy Yacob Date: Thu, 28 May 2026 08:31:57 +0700 Subject: [PATCH] feat: display alert dialog instead of returning object when preventing deletion of sent kitchen items --- static/src/app/models/pos_order.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/static/src/app/models/pos_order.js b/static/src/app/models/pos_order.js index fcc0825..6f2c93e 100644 --- a/static/src/app/models/pos_order.js +++ b/static/src/app/models/pos_order.js @@ -1,6 +1,7 @@ import { PosOrder } from "@point_of_sale/app/models/pos_order"; import { patch } from "@web/core/utils/patch"; import { _t } from "@web/core/l10n/translation"; +import { AlertDialog } from "@web/core/confirmation_dialog/confirmation_dialog"; import { transferState } from "../transfer_state"; patch(PosOrder.prototype, { @@ -45,10 +46,11 @@ patch(PosOrder.prototype, { line.setQuantity(lockedQty); return false; } - return { + this.models.pos.dialog.add(AlertDialog, { title: _t("Action Restricted"), body: _t("You cannot delete a product that has already been sent to the kitchen. Please call an Area Manager or Store Manager."), - }; + }); + return false; } else { // Recorded cancellation log for the deletion this.x_cancelled_lines = this.x_cancelled_lines || [];