[FIX] point_of_sale: prevent empty order creation as they are not accepted by the...
[odoo/odoo.git] / addons / point_of_sale / static / src / js / screens.js
index 2ce5adf..63caa5f 100644 (file)
@@ -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;
             }