diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js
index d8e53066c1e..61c6d1cc2b8 100644
--- a/addons/point_of_sale/static/src/js/screens.js
+++ b/addons/point_of_sale/static/src/js/screens.js
@@ -430,6 +430,10 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
template:'ErrorSessionPopupWidget',
});
+ module.ErrorNegativePricePopupWidget = module.ErrorPopupWidget.extend({
+ template:'ErrorNegativePricePopupWidget',
+ });
+
module.ScaleInviteScreenWidget = module.ScreenWidget.extend({
template:'ScaleInviteScreenWidget',
@@ -684,8 +688,12 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
console.log("CANCEL_END");
return (new $.Deferred()).resolve();
}
-
- this.queue.schedule(this.start);
+
+ if(this.pos.get('selectedOrder').getDueLeft() <= 0){
+ this.pos_widget.screen_selector.show_popup('error-negative-price');
+ }else{
+ this.queue.schedule(this.start);
+ }
this.add_action_button({
label: 'back',
diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js
index 4984ee5dda9..6038a74b35e 100644
--- a/addons/point_of_sale/static/src/js/widgets.js
+++ b/addons/point_of_sale/static/src/js/widgets.js
@@ -904,6 +904,9 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
this.choose_receipt_popup = new module.ChooseReceiptPopupWidget(this, {});
this.choose_receipt_popup.appendTo($('.point-of-sale'));
+ this.error_negative_price_popup = new module.ErrorNegativePricePopupWidget(this, {});
+ this.error_negative_price_popup.appendTo($('.point-of-sale'));
+
// -------- Misc ---------
this.notification = new module.SynchNotificationWidget(this,{});
@@ -963,6 +966,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
'error': this.error_popup,
'error-product': this.error_product_popup,
'error-session': this.error_session_popup,
+ 'error-negative-price': this.error_negative_price_popup,
'choose-receipt': this.choose_receipt_popup,
},
default_client_screen: 'welcome',
diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml
index cb4d90f1671..6171869cbb4 100644
--- a/addons/point_of_sale/static/src/xml/pos.xml
+++ b/addons/point_of_sale/static/src/xml/pos.xml
@@ -351,6 +351,14 @@
+
+
+
+
+
+