From: Frederic van der Essen Date: Tue, 7 Oct 2014 16:18:59 +0000 (+0200) Subject: [FIX] point_of_sale: prevent empty order creation as they are not accepted by the... X-Git-Tag: InsPy_8.0_01~4^2~60 X-Git-Url: http://git.inspyration.org/?a=commitdiff_plain;h=717895be1aae3b89eca3f694854700ae597b3c6a;p=odoo%2Fodoo.git [FIX] point_of_sale: prevent empty order creation as they are not accepted by the backend --- diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 2ce5adf..63caa5f 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -1245,6 +1245,14 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa var currentOrder = this.pos.get('selectedOrder'); + if(currentOrder.get('orderLines').models.length === 0){ + this.pos_widget.screen_selector.show_popup('error',{ + 'message': _t('Empty Order'), + 'comment': _t('There must be at least one product in your order before it can be validated'), + }); + return; + } + if(!this.is_paid()){ return; }