From 41a7325ac3db328ac68a71a134796cd490c89d08 Mon Sep 17 00:00:00 2001 From: AjmalCybro Date: Fri, 24 Nov 2023 15:48:05 +0530 Subject: [PATCH] Nov 24 : [FIX] Bug Fixed 'pos_discount_manager' --- pos_discount_manager/doc/RELEASE_NOTES.md | 8 +++++++- pos_discount_manager/static/src/js/PosSession.js | 2 +- pos_discount_manager/static/src/js/ValidateManager.js | 6 ++++-- pos_discount_manager/static/src/xml/NumberPopup.xml | 2 +- pos_discount_manager/views/hr_employee_views.xml | 2 +- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/pos_discount_manager/doc/RELEASE_NOTES.md b/pos_discount_manager/doc/RELEASE_NOTES.md index eed11b767..e1590cc42 100755 --- a/pos_discount_manager/doc/RELEASE_NOTES.md +++ b/pos_discount_manager/doc/RELEASE_NOTES.md @@ -9,4 +9,10 @@ #### Version 16.0.2.0.1 #### FIX - Removed the already existing function from payment screen js function. -- Super the existing button action. \ No newline at end of file +- Super the existing button action. + +#### 20.11.2023 +#### Version 16.0.2.0.2 +#### UPDATE +- Manager Pin Encrypted in NumberPad. +- Changed Pin Condition Check from Top Sequence Manager to Session Manager. \ No newline at end of file diff --git a/pos_discount_manager/static/src/js/PosSession.js b/pos_discount_manager/static/src/js/PosSession.js index e05962c78..0f8ecc6e6 100755 --- a/pos_discount_manager/static/src/js/PosSession.js +++ b/pos_discount_manager/static/src/js/PosSession.js @@ -13,4 +13,4 @@ odoo.define('pos_discount_manager.PosSession', function(require) { } } Registries.Model.extend(PosGlobalState,NewPosGlobalState) - }); \ No newline at end of file + }); diff --git a/pos_discount_manager/static/src/js/ValidateManager.js b/pos_discount_manager/static/src/js/ValidateManager.js index 80848dda3..e2a40e2a5 100755 --- a/pos_discount_manager/static/src/js/ValidateManager.js +++ b/pos_discount_manager/static/src/js/ValidateManager.js @@ -3,6 +3,7 @@ odoo.define('pos_discount_manager.ValidateManager', function(require) { const Registries = require('point_of_sale.Registries'); const PaymentScreen = require('point_of_sale.PaymentScreen'); + var session = require('web.session'); const ValidateManagers = (PaymentScreen) => class extends PaymentScreen { @@ -22,9 +23,10 @@ odoo.define('pos_discount_manager.ValidateManager', function(require) { if (flag != 1) { const {confirmed,payload} = await this.showPopup('NumberPopup', { title: this.env._t(employee_name + ', your discount is over the limit. \n Manager pin for Approval'), + isPassword: true }); if(confirmed){ - var output = this.env.pos.employees.filter((obj) => obj.role == 'manager'); + var output = this.env.pos.employees.filter((obj) => obj.role == 'manager' && obj.user_id == session.uid); var pin = output[0].pin if (Sha1.hash(payload) == pin) { this.showScreen(this.nextScreen); @@ -52,4 +54,4 @@ odoo.define('pos_discount_manager.ValidateManager', function(require) { } Registries.Component.extend(PaymentScreen, ValidateManagers); return ValidateManagers; -}); \ No newline at end of file +}); diff --git a/pos_discount_manager/static/src/xml/NumberPopup.xml b/pos_discount_manager/static/src/xml/NumberPopup.xml index 515b1de53..39a646f90 100755 --- a/pos_discount_manager/static/src/xml/NumberPopup.xml +++ b/pos_discount_manager/static/src/xml/NumberPopup.xml @@ -72,4 +72,4 @@ - \ No newline at end of file + diff --git a/pos_discount_manager/views/hr_employee_views.xml b/pos_discount_manager/views/hr_employee_views.xml index e5db454f7..ea784f567 100755 --- a/pos_discount_manager/views/hr_employee_views.xml +++ b/pos_discount_manager/views/hr_employee_views.xml @@ -12,4 +12,4 @@ - \ No newline at end of file +