From 5dba2b6e09e45225adadcb07612811966ed2d74a Mon Sep 17 00:00:00 2001 From: Gert Pellin - GPE Date: Mon, 17 Sep 2018 14:07:22 +0200 Subject: [PATCH] [FIX] point_of_sale: deactivate price change on switch from admin on price control (#26994) Usecase: * Activate price control on point of sale. * In pos session, as administrator, activate pricechange modus. * switch to normal user. Before fix normal user can change the price. After fix the modus will automatically switch to quantity. --- addons/point_of_sale/static/src/js/screens.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index a50ccb14c0e..f0623933788 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -399,6 +399,9 @@ var NumpadWidget = PosBaseWidget.extend({ this.$el.find('.mode-button[data-mode="price"]') .toggleClass('disabled-mode', !has_price_control_rights) .prop('disabled', !has_price_control_rights); + if (!has_price_control_rights && this.state.get('mode')=='price'){ + this.state.changeMode('quantity'); + } }, clickDeleteLastChar: function() { return this.state.deleteLastChar();