Tower: upload laundry_management 19.0.19.0.4 (via marketplace)
This commit is contained in:
@@ -0,0 +1,31 @@
|
|||||||
|
/** @odoo-module */
|
||||||
|
import { patch } from "@web/core/utils/patch";
|
||||||
|
import { _t } from "@web/core/l10n/translation";
|
||||||
|
import OrderPaymentValidation from "@point_of_sale/app/utils/order_payment_validation";
|
||||||
|
import { ask } from "@point_of_sale/app/utils/make_awaitable_dialog";
|
||||||
|
|
||||||
|
patch(OrderPaymentValidation.prototype, {
|
||||||
|
async askBeforeValidation() {
|
||||||
|
const result = await super.askBeforeValidation();
|
||||||
|
if (result === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// Only enforce customer for orders with laundry products
|
||||||
|
const hasLaundry = this.order.lines.some(
|
||||||
|
(line) => line.product_id?.product_tmpl_id?.is_laundry_service
|
||||||
|
);
|
||||||
|
if (hasLaundry && !this.order.getPartner()) {
|
||||||
|
const confirmed = await ask(this.pos.dialog, {
|
||||||
|
title: _t("Customer Required"),
|
||||||
|
body: _t(
|
||||||
|
"This order contains laundry items. Please select a customer before validating."
|
||||||
|
),
|
||||||
|
});
|
||||||
|
if (confirmed) {
|
||||||
|
await this.pos.selectPartner();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user