跳至内容
菜单
此问题已终结
1 回复
2427 查看

it is possible to make it mandatory to choose a customer before validating the payment in POS?

形象
丢弃
最佳答案

Hi 

Try this code:

    const PaymentScreen = require('point_of_sale.PaymentScreen');

    const Registries = require('point_of_sale.Registries');


    const PosDeResPaymentScreen = PaymentScreen => class extends PaymentScreen {

        //@Override

        async validateOrder(isForceValidate) {const currentPartner = this.currentOrder.get_client();

        if (currentPartner == null) {

                    await this.showPopup('ErrorPopup', {

   title: _t('Unknown'),

   body: _t("Choose Customer First."),

                });


        }

                await super.validateOrder(...arguments);

    }, Registries.Component.extend(PaymentScreen, PosDeResPaymentScreen);


    return PaymentScreen;

});


Hope it helps

形象
丢弃
相关帖文 回复 查看 活动
3
9月 25
235
0
10月 24
1741
1
11月 22
5652
1
3月 15
5168
1
2月 22
6296