Skip to content

Commit

Permalink
[FIX] point_of_sale: wrong behavior Price Control (odoo#26232)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
switch87 committed Aug 8, 2018
1 parent a4a9196 commit bb8bb3c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion addons/point_of_sale/static/src/js/screens.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bb8bb3c

Please sign in to comment.