diff options
| author | Gert Pellin <switch87@users.noreply.github.com> | 2018-08-08 09:59:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-08 09:59:20 +0200 |
| commit | bb8bb3cbfe07a23c0adad173a6afcc7bcaccedc7 (patch) | |
| tree | fcd4899bc1f49cdd76d17da0ac9c8ee42a060bf5 | |
| parent | a4a9196c8d18cf0e994cb760fe4ed7db286483cd (diff) | |
[FIX] point_of_sale: wrong behavior Price Control (#26232)
Before the fix price control only worked like should on initialisation of a pos section. On switching cashier during a setting manager would lose price change rights and normal users would gain them.
| -rw-r--r-- | addons/point_of_sale/static/src/js/screens.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 95a7555e5d2..182af5308d4 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -394,7 +394,9 @@ var NumpadWidget = PosBaseWidget.extend({ this.$el.find('.mode-button').click(_.bind(this.clickChangeMode, this)); }, applyAccessRights: function() { - var has_price_control_rights = !this.pos.config.restrict_price_control || this.pos.get_cashier().role == 'manager'; + var has_price_control_rights = !this.pos.config.restrict_price_control + || (this.pos.changed.cashier && this.pos.changed.cashier.role == 'manager') + || (!this.pos.changed.cashier && this.pos.get_cashier().role == 'manager'); this.$el.find('.mode-button[data-mode="price"]') .toggleClass('disabled-mode', !has_price_control_rights) .prop('disabled', !has_price_control_rights); |
