feat: display alert dialog instead of returning object when preventing deletion of sent kitchen items
This commit is contained in:
parent
dad62e5711
commit
bb7d9327ee
@ -1,6 +1,7 @@
|
|||||||
import { PosOrder } from "@point_of_sale/app/models/pos_order";
|
import { PosOrder } from "@point_of_sale/app/models/pos_order";
|
||||||
import { patch } from "@web/core/utils/patch";
|
import { patch } from "@web/core/utils/patch";
|
||||||
import { _t } from "@web/core/l10n/translation";
|
import { _t } from "@web/core/l10n/translation";
|
||||||
|
import { AlertDialog } from "@web/core/confirmation_dialog/confirmation_dialog";
|
||||||
import { transferState } from "../transfer_state";
|
import { transferState } from "../transfer_state";
|
||||||
|
|
||||||
patch(PosOrder.prototype, {
|
patch(PosOrder.prototype, {
|
||||||
@ -45,10 +46,11 @@ patch(PosOrder.prototype, {
|
|||||||
line.setQuantity(lockedQty);
|
line.setQuantity(lockedQty);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return {
|
this.models.pos.dialog.add(AlertDialog, {
|
||||||
title: _t("Action Restricted"),
|
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."),
|
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 {
|
} else {
|
||||||
// Recorded cancellation log for the deletion
|
// Recorded cancellation log for the deletion
|
||||||
this.x_cancelled_lines = this.x_cancelled_lines || [];
|
this.x_cancelled_lines = this.x_cancelled_lines || [];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user