From ece860fce016d462f777313776203a069c27849f Mon Sep 17 00:00:00 2001 From: RisvanaCybro Date: Fri, 10 May 2024 15:38:43 +0530 Subject: [PATCH] May 10: [FIX] Bug Fixed 'pos_refund_password' --- pos_refund_password/__manifest__.py | 2 +- pos_refund_password/doc/RELEASE_NOTES.md | 5 +++++ pos_refund_password/model/pos_config.py | 6 +++++- pos_refund_password/static/src/js/ticket_screen.js | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/pos_refund_password/__manifest__.py b/pos_refund_password/__manifest__.py index d1dbd9fa6..6322210b6 100644 --- a/pos_refund_password/__manifest__.py +++ b/pos_refund_password/__manifest__.py @@ -21,7 +21,7 @@ ############################################################################### { 'name': 'Restrict POS Refund with Password', - 'version': '17.0.1.0.0', + 'version': '17.0.1.0.1', 'summary': """Restrict POS Refund with Password In Odoo 17""", 'description': """POS Restrict Refund helps to set password protection for refunds, ensuring authorized access""", diff --git a/pos_refund_password/doc/RELEASE_NOTES.md b/pos_refund_password/doc/RELEASE_NOTES.md index ac8a5880a..953e4098a 100644 --- a/pos_refund_password/doc/RELEASE_NOTES.md +++ b/pos_refund_password/doc/RELEASE_NOTES.md @@ -4,3 +4,8 @@ #### Version 17.0.1.0.0 #### ADD - Initial commit for Restrict POS Refund with Password + +#### 02.05.2024 +#### Version 17.0.1.0.1 +#### ADD +- The issue while trying to process a refund by a user other than the admin has been fixed. \ No newline at end of file diff --git a/pos_refund_password/model/pos_config.py b/pos_refund_password/model/pos_config.py index f38b07526..efa47d61b 100644 --- a/pos_refund_password/model/pos_config.py +++ b/pos_refund_password/model/pos_config.py @@ -19,7 +19,7 @@ # If not, see . # ############################################################################### -from odoo import models, fields +from odoo import api, models, fields class PosConfig(models.Model): @@ -29,3 +29,7 @@ class PosConfig(models.Model): refund_security = fields.Integer(string='Refund Security', help="Refund security password, used for " "that specified shop") + @api.model + def fetch_global_refund_security(self): + param = self.env['ir.config_parameter'].sudo().get_param('pos_refund_password.global_refund_security') + return param diff --git a/pos_refund_password/static/src/js/ticket_screen.js b/pos_refund_password/static/src/js/ticket_screen.js index 1b9c1897f..700024e94 100644 --- a/pos_refund_password/static/src/js/ticket_screen.js +++ b/pos_refund_password/static/src/js/ticket_screen.js @@ -11,7 +11,7 @@ patch(TicketScreen.prototype, { async onDoRefund() { var refund=""; var session_refund= false; - var data = await this.orm.call("ir.config_parameter", "get_param", ["pos_refund_password.global_refund_security"]) + var data = await this.orm.call("pos.config", "fetch_global_refund_security", []) refund = data; if (!refund){ session_refund = this.pos.config.refund_security;