diff --git a/pos_access_right_hr/__manifest__.py b/pos_access_right_hr/__manifest__.py index 7a224fb3f..116090e05 100644 --- a/pos_access_right_hr/__manifest__.py +++ b/pos_access_right_hr/__manifest__.py @@ -21,7 +21,7 @@ ############################################################################# { 'name': 'POS Access Right', - 'version': '16.0.1.0.0', + 'version': '16.0.1.0.2', "category": 'Point of Sale', 'summary': 'To Restrict POS features for cashiers', 'description': 'This app allows you to enable or disable POS features ' diff --git a/pos_access_right_hr/doc/RELEASE_NOTES.md b/pos_access_right_hr/doc/RELEASE_NOTES.md index 9177e2579..6ddcbdd53 100644 --- a/pos_access_right_hr/doc/RELEASE_NOTES.md +++ b/pos_access_right_hr/doc/RELEASE_NOTES.md @@ -9,3 +9,8 @@ #### Version 16.0.1.0.1 ##### FIX - Fix the keyboard event handling issue + +#### 10.09.2025 +#### Version 16.0.1.0.2 +##### FIX +- Updated the keyboard event handling issue for all keys. diff --git a/pos_access_right_hr/static/src/js/ActionpadWidgetAccessRight.js b/pos_access_right_hr/static/src/js/ActionpadWidgetAccessRight.js index fd3cfc3fd..731da2332 100644 --- a/pos_access_right_hr/static/src/js/ActionpadWidgetAccessRight.js +++ b/pos_access_right_hr/static/src/js/ActionpadWidgetAccessRight.js @@ -3,21 +3,19 @@ odoo.define('pos_access_right_hr.ActionPad_extension', function(require) { const ActionpadWidget = require('point_of_sale.ActionpadWidget'); const Registries = require('point_of_sale.Registries'); const ActionpadWidgetAccessRight= ActionpadWidget => class extends ActionpadWidget { - //To enable or disable buttons in the ActionpadWidget - /** * Disable the customer selection button on the POS */ get disable_customer() { if (this.env.pos.config.module_pos_hr) { - const cashierId = this.env.pos.get_cashier().id; - const sessionAccess = this.env.pos.session_access.find(access => access.id === cashierId); - if (sessionAccess && sessionAccess.disable_customer) { - self.$('#customer_disable').css({ "border": "1px solid #C9CCD2", "background-color": "#E0E2E6","color":"#666666" }); - } - return sessionAccess ? sessionAccess.disable_customer : false; - } - else {return false;} + const cashierId = this.env.pos.get_cashier().id; + const sessionAccess = this.env.pos.session_access.find(access => access.id === cashierId); + if (sessionAccess && sessionAccess.disable_customer) { + self.$('#customer_disable').css({ "border": "1px solid #C9CCD2", "background-color": "#E0E2E6","color":"#666666" }); + } + return sessionAccess ? sessionAccess.disable_customer : false; + } + else {return false;} } /** * Disable the customer selection button on the POS diff --git a/pos_access_right_hr/static/src/js/NumpadWidgetAccessRight.js b/pos_access_right_hr/static/src/js/NumpadWidgetAccessRight.js index b0698bac6..937432c0c 100644 --- a/pos_access_right_hr/static/src/js/NumpadWidgetAccessRight.js +++ b/pos_access_right_hr/static/src/js/NumpadWidgetAccessRight.js @@ -64,7 +64,6 @@ odoo.define('pos_access_right_hr.CustomOrdrScreen', function(require) { } else { return false;} } - /** * Disable the back button on the POS */ diff --git a/pos_access_right_hr/static/src/js/ProductScreenAccessRight.js b/pos_access_right_hr/static/src/js/ProductScreenAccessRight.js index 89588861e..c71d882f8 100644 --- a/pos_access_right_hr/static/src/js/ProductScreenAccessRight.js +++ b/pos_access_right_hr/static/src/js/ProductScreenAccessRight.js @@ -22,6 +22,17 @@ odoo.define('pos_access_right_hr.ProductScreenAccessRight', function(require) { if ((event.detail.key === "Backspace" || event.detail.key === "Delete" ) && this.check_remove_access()){ return; } + const cashierId = this.env.pos.get_cashier().id; + const sessionAccess = this.env.pos.session_access.find(access => access.id === cashierId); + if (/^[0-9]$/.test(event.detail.key) && sessionAccess?.disable_numpad) { + return; + } + else if (event.detail.key === '-' && sessionAccess?.disable_plus_minus) { + return; // Block + key + } + else if (event.detail.key === '+' && sessionAccess?.disable_plus_minus) { + return; // Block + key + } return super._updateSelectedOrderline(...arguments); } }