summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGert Pellin - GPE <switch87@users.noreply.github.com>2018-09-17 14:07:22 +0200
committerGitHub <noreply@github.com>2018-09-17 14:07:22 +0200
commit5dba2b6e09e45225adadcb07612811966ed2d74a (patch)
tree619ca3de79644db149cdb34cbda2499cf1e34c23
parent2c7db142614bc548b4aa6b739e5ead6ad375ab21 (diff)
[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.
-rw-r--r--addons/point_of_sale/static/src/js/screens.js3
1 files changed, 3 insertions, 0 deletions
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();