You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
1.1 KiB
25 lines
1.1 KiB
/** @odoo-module **/
|
|
import PaymentScreen from 'point_of_sale.PaymentScreen';
|
|
import Registries from 'point_of_sale.Registries';
|
|
export const PosLoyaltyPaymentScreen = (PaymentScreen) =>
|
|
class extends PaymentScreen {
|
|
//@override
|
|
async validateOrder(isForceValidate) {
|
|
const order = this.currentOrder;
|
|
const hasWashingType = order.get_orderlines().some(line => line.washingType);
|
|
if (hasWashingType && !order.get_partner()) {
|
|
const { confirmed } = await this.showPopup('ConfirmPopup', {
|
|
title: this.env._t('Please select the Customer'),
|
|
body: this.env._t(
|
|
'You need to select the customer for the order contains laundry products.'
|
|
),
|
|
});
|
|
if (confirmed) {
|
|
this.selectPartner();
|
|
}
|
|
return false
|
|
}
|
|
await super.validateOrder(...arguments);
|
|
}
|
|
};
|
|
Registries.Component.extend(PaymentScreen, PosLoyaltyPaymentScreen);
|
|
|