Browse Source

Sep 13: [FIX] Bug fixed 'pos_access_right_hr'

16.0
Risvana Cybro 1 day ago
parent
commit
51257c322e
  1. 2
      pos_access_right_hr/__manifest__.py
  2. 5
      pos_access_right_hr/doc/RELEASE_NOTES.md
  3. 18
      pos_access_right_hr/static/src/js/ActionpadWidgetAccessRight.js
  4. 1
      pos_access_right_hr/static/src/js/NumpadWidgetAccessRight.js
  5. 11
      pos_access_right_hr/static/src/js/ProductScreenAccessRight.js

2
pos_access_right_hr/__manifest__.py

@ -21,7 +21,7 @@
############################################################################# #############################################################################
{ {
'name': 'POS Access Right', 'name': 'POS Access Right',
'version': '16.0.1.0.0', 'version': '16.0.1.0.2',
"category": 'Point of Sale', "category": 'Point of Sale',
'summary': 'To Restrict POS features for cashiers', 'summary': 'To Restrict POS features for cashiers',
'description': 'This app allows you to enable or disable POS features ' 'description': 'This app allows you to enable or disable POS features '

5
pos_access_right_hr/doc/RELEASE_NOTES.md

@ -9,3 +9,8 @@
#### Version 16.0.1.0.1 #### Version 16.0.1.0.1
##### FIX ##### FIX
- Fix the keyboard event handling issue - 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.

18
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 ActionpadWidget = require('point_of_sale.ActionpadWidget');
const Registries = require('point_of_sale.Registries'); const Registries = require('point_of_sale.Registries');
const ActionpadWidgetAccessRight= ActionpadWidget => class extends ActionpadWidget { const ActionpadWidgetAccessRight= ActionpadWidget => class extends ActionpadWidget {
//To enable or disable buttons in the ActionpadWidget
/** /**
* Disable the customer selection button on the POS * Disable the customer selection button on the POS
*/ */
get disable_customer() { get disable_customer() {
if (this.env.pos.config.module_pos_hr) { if (this.env.pos.config.module_pos_hr) {
const cashierId = this.env.pos.get_cashier().id; const cashierId = this.env.pos.get_cashier().id;
const sessionAccess = this.env.pos.session_access.find(access => access.id === cashierId); const sessionAccess = this.env.pos.session_access.find(access => access.id === cashierId);
if (sessionAccess && sessionAccess.disable_customer) { if (sessionAccess && sessionAccess.disable_customer) {
self.$('#customer_disable').css({ "border": "1px solid #C9CCD2", "background-color": "#E0E2E6","color":"#666666" }); self.$('#customer_disable').css({ "border": "1px solid #C9CCD2", "background-color": "#E0E2E6","color":"#666666" });
} }
return sessionAccess ? sessionAccess.disable_customer : false; return sessionAccess ? sessionAccess.disable_customer : false;
} }
else {return false;} else {return false;}
} }
/** /**
* Disable the customer selection button on the POS * Disable the customer selection button on the POS

1
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;} else { return false;}
} }
/** /**
* Disable the back button on the POS * Disable the back button on the POS
*/ */

11
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()){ if ((event.detail.key === "Backspace" || event.detail.key === "Delete" ) && this.check_remove_access()){
return; 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); return super._updateSelectedOrderline(...arguments);
} }
} }

Loading…
Cancel
Save