Browse Source

[IMP] pos_access_right: lint improvements

pull/324/head
Gabriela Rivero 6 years ago
parent
commit
7db7bf90fa
  1. 19
      pos_access_right/static/src/js/pos_access_right.js

19
pos_access_right/static/src/js/pos_access_right.js

@ -38,18 +38,14 @@ odoo.define('pos_access_right.pos_access_right', function (require) {
$('.numpad-minus').removeClass('pos-disabled-mode'); $('.numpad-minus').removeClass('pos-disabled-mode');
} }
if (groups_id.indexOf(group_discount_id) === -1) { if (groups_id.indexOf(group_discount_id) === -1) {
$(".mode-button[data-mode='discount']").
addClass('pos-disabled-mode');
$(".mode-button[data-mode='discount']").addClass('pos-disabled-mode');
} else { } else {
$(".mode-button[data-mode='discount']").
removeClass('pos-disabled-mode');
$(".mode-button[data-mode='discount']").removeClass('pos-disabled-mode');
} }
if (groups_id.indexOf(group_price_id) === -1) { if (groups_id.indexOf(group_price_id) === -1) {
$(".mode-button[data-mode='price']").
addClass('pos-disabled-mode');
$(".mode-button[data-mode='price']").addClass('pos-disabled-mode');
} else { } else {
$(".mode-button[data-mode='price']").
removeClass('pos-disabled-mode');
$(".mode-button[data-mode='price']").removeClass('pos-disabled-mode');
} }
} }
); );
@ -153,7 +149,7 @@ odoo.define('pos_access_right.pos_access_right', function (require) {
if (groups_id.indexOf(group_neg_qty_id) === -1) { if (groups_id.indexOf(group_neg_qty_id) === -1) {
gui.show_popup('error', { gui.show_popup('error', {
'title': 'title':
_t('Negative Quantity - \Unauthorized function'),
_t('Negative Quantity - Unauthorized function'),
'body': _t('Please ask your manager to do it.'), 'body': _t('Please ask your manager to do it.'),
}); });
} }
@ -163,7 +159,7 @@ odoo.define('pos_access_right.pos_access_right', function (require) {
}, },
// Block 'discount' or 'price' button if user doesn't belong to the // Block 'discount' or 'price' button if user doesn't belong to the
//correct group
// Correct group
clickChangeMode: function (event) { clickChangeMode: function (event) {
var user = this.pos.get_cashier(); var user = this.pos.get_cashier();
var records = new Model('res.users') var records = new Model('res.users')
@ -183,8 +179,7 @@ odoo.define('pos_access_right.pos_access_right', function (require) {
'title': _t('Discount - Unauthorized function'), 'title': _t('Discount - Unauthorized function'),
'body': _t('Please ask your manager to do it.'), 'body': _t('Please ask your manager to do it.'),
}); });
} else if (event.currentTarget.attributes['data-mode'].nodeValue
=== 'price' &&
} else if (event.currentTarget.attributes['data-mode'].nodeValue === 'price' &&
groups_id.indexOf(group_price_id) === -1) { groups_id.indexOf(group_price_id) === -1) {
gui.show_popup('error', { gui.show_popup('error', {
'title': 'title':

Loading…
Cancel
Save