|
|
@ -38,18 +38,14 @@ odoo.define('pos_access_right.pos_access_right', function (require) { |
|
|
|
$('.numpad-minus').removeClass('pos-disabled-mode'); |
|
|
|
} |
|
|
|
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 { |
|
|
|
$(".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) { |
|
|
|
$(".mode-button[data-mode='price']"). |
|
|
|
addClass('pos-disabled-mode'); |
|
|
|
$(".mode-button[data-mode='price']").addClass('pos-disabled-mode'); |
|
|
|
} 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) { |
|
|
|
gui.show_popup('error', { |
|
|
|
'title': |
|
|
|
_t('Negative Quantity - \Unauthorized function'), |
|
|
|
_t('Negative Quantity - Unauthorized function'), |
|
|
|
'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
|
|
|
|
//correct group
|
|
|
|
// Correct group
|
|
|
|
clickChangeMode: function (event) { |
|
|
|
var user = this.pos.get_cashier(); |
|
|
|
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'), |
|
|
|
'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) { |
|
|
|
gui.show_popup('error', { |
|
|
|
'title': |
|
|
|