Browse Source

Sep 13: [FIX] Bug fixed 'pos_access_right_hr'

15.0
Risvana Cybro 1 week ago
parent
commit
b18322158a
  1. 3
      pos_access_right_hr/__manifest__.py
  2. 5
      pos_access_right_hr/doc/RELEASE_NOTES.md
  3. 1
      pos_access_right_hr/static/src/js/models.js
  4. 34
      pos_access_right_hr/static/src/js/product_screen.js

3
pos_access_right_hr/__manifest__.py

@ -21,7 +21,7 @@
############################################################################# #############################################################################
{ {
'name': 'POS Access Right', 'name': 'POS Access Right',
'version': '15.0.1.0.0', 'version': '15.0.1.0.1',
"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 '
@ -39,6 +39,7 @@
'pos_access_right_hr/static/src/js/models.js', 'pos_access_right_hr/static/src/js/models.js',
'pos_access_right_hr/static/src/js/NumpadWidget.js', 'pos_access_right_hr/static/src/js/NumpadWidget.js',
'pos_access_right_hr/static/src/js/ActionpadWidget.js', 'pos_access_right_hr/static/src/js/ActionpadWidget.js',
'pos_access_right_hr/static/src/js/product_screen.js',
], ],
'web.assets_qweb': [ 'web.assets_qweb': [
'pos_access_right_hr/static/src/xml/NumpadWidget.xml', 'pos_access_right_hr/static/src/xml/NumpadWidget.xml',

5
pos_access_right_hr/doc/RELEASE_NOTES.md

@ -4,3 +4,8 @@
#### Version 15.0.1.0.0 #### Version 15.0.1.0.0
##### ADD ##### ADD
- Initial commit for POS Access Right - Initial commit for POS Access Right
#### 10.09.2025
#### Version 15.0.1.0.1
##### UPDT
- Updated the module restricting the keyboard input events.

1
pos_access_right_hr/static/src/js/models.js

@ -1,6 +1,5 @@
odoo.define('pos_access_right_hr.models', function(require) { odoo.define('pos_access_right_hr.models', function(require) {
'use strict'; 'use strict';
var models = require('point_of_sale.models'); var models = require('point_of_sale.models');
/** /**
To load fields from hr.employee into pos To load fields from hr.employee into pos

34
pos_access_right_hr/static/src/js/product_screen.js

@ -0,0 +1,34 @@
odoo.define('pos_access_right_hr.ProductScreen', function (require) {
'use strict';
const ProductScreen = require('point_of_sale.ProductScreen');
const Registries = require('point_of_sale.Registries');
const PosAccessRightHrProductScreen = (ProductScreen) =>
class extends ProductScreen {
constructor() {
super(...arguments);
}
async _updateSelectedOrderline(event) {
const user = this.env.pos.get_cashier()
if ((event.detail.key === "Backspace" || event.detail.key === "Delete" ) && user.disable_remove_button){
return;
}
if (/^[0-9]$/.test(event.detail.key) && user?.disable_numpad) {
return;
}
else if (event.detail.key === '-' && user?.disable_plus_minus) {
return; // Block + key
}
else if (event.detail.key === '+' && user?.disable_plus_minus) {
return; // Block + key
}
return super._updateSelectedOrderline(...arguments);
}
};
Registries.Component.extend(ProductScreen, PosAccessRightHrProductScreen);
return ProductScreen;
});
Loading…
Cancel
Save