Browse Source

Jan 8 [UPDT] : Updated 'pos_access_right_hr'

pull/299/head
AjmalCybro 1 year ago
parent
commit
0ef01fc205
  1. 2
      pos_access_right_hr/__init__.py
  2. 5
      pos_access_right_hr/__manifest__.py
  3. 5
      pos_access_right_hr/doc/RELEASE_NOTES.md
  4. 2
      pos_access_right_hr/models/__init__.py
  5. 2
      pos_access_right_hr/models/hr_employee.py
  6. 2
      pos_access_right_hr/models/pos_session.py
  7. 30
      pos_access_right_hr/static/src/js/ProductScreenAccessRight.js

2
pos_access_right_hr/__init__.py

@ -4,7 +4,7 @@
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
# Author: Viswanth k (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.

5
pos_access_right_hr/__manifest__.py

@ -4,7 +4,7 @@
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
# Author: Viswanth k (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
@ -40,7 +40,8 @@
'pos_access_right_hr/static/src/js/NumpadWidgetAccessRight.js',
'pos_access_right_hr/static/src/js/ActionpadWidgetAccessRight.js',
'pos_access_right_hr/static/src/xml/NumpadWidgetAccessRight.xml',
'pos_access_right_hr/static/src/xml/ActionpadWidgetAccessRight.xml'
'pos_access_right_hr/static/src/xml/ActionpadWidgetAccessRight.xml',
'pos_access_right_hr/static/src/js/ProductScreenAccessRight.js'
],
},
'images': ['static/description/banner.png'],

5
pos_access_right_hr/doc/RELEASE_NOTES.md

@ -4,3 +4,8 @@
#### Version 16.0.1.0.0
##### ADD
- Initial commit for POS Access Right
#### 02.01.2024
#### Version 16.0.1.0.1
##### FIX
- Fix the keyboard event handling issue

2
pos_access_right_hr/models/__init__.py

@ -4,7 +4,7 @@
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
# Author: Viswanth k (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.

2
pos_access_right_hr/models/hr_employee.py

@ -4,7 +4,7 @@
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
# Author: Viswanth k (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.

2
pos_access_right_hr/models/pos_session.py

@ -4,7 +4,7 @@
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
# Author: Viswanth k (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.

30
pos_access_right_hr/static/src/js/ProductScreenAccessRight.js

@ -0,0 +1,30 @@
odoo.define('pos_access_right_hr.ProductScreenAccessRight', function(require) {
'use strict';
const ProductScreen = require('point_of_sale.ProductScreen');
const Registries = require('point_of_sale.Registries');
const ProductScreenAccessRight= (ProductScreen) => class extends ProductScreen{
/**
* method to check the access of the cashier to use Delete and Backspace in ProductScreen
*/
check_remove_access() {
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);
return sessionAccess ? sessionAccess.disable_remove_button : false;
} else {
return false;
}
}
/**
* Override the method for disabling the usage of Delete and Backspace keys based on the access set for the cashier
*/
async _updateSelectedOrderline(event) {
if ((event.detail.key === "Backspace" || event.detail.key === "Delete" ) && this.check_remove_access()){
return;
}
return super._updateSelectedOrderline(...arguments);
}
}
Registries.Component.extend(ProductScreen, ProductScreenAccessRight);
return ProductScreen;
});
Loading…
Cancel
Save