Browse Source

May 10: [FIX] Bug Fixed 'pos_refund_password'

pull/317/head
RisvanaCybro 12 months ago
parent
commit
ece860fce0
  1. 2
      pos_refund_password/__manifest__.py
  2. 5
      pos_refund_password/doc/RELEASE_NOTES.md
  3. 6
      pos_refund_password/model/pos_config.py
  4. 2
      pos_refund_password/static/src/js/ticket_screen.js

2
pos_refund_password/__manifest__.py

@ -21,7 +21,7 @@
############################################################################### ###############################################################################
{ {
'name': 'Restrict POS Refund with Password', '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""", 'summary': """Restrict POS Refund with Password In Odoo 17""",
'description': """POS Restrict Refund helps to set password protection for 'description': """POS Restrict Refund helps to set password protection for
refunds, ensuring authorized access""", refunds, ensuring authorized access""",

5
pos_refund_password/doc/RELEASE_NOTES.md

@ -4,3 +4,8 @@
#### Version 17.0.1.0.0 #### Version 17.0.1.0.0
#### ADD #### ADD
- Initial commit for Restrict POS Refund with Password - 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.

6
pos_refund_password/model/pos_config.py

@ -19,7 +19,7 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################### ###############################################################################
from odoo import models, fields from odoo import api, models, fields
class PosConfig(models.Model): class PosConfig(models.Model):
@ -29,3 +29,7 @@ class PosConfig(models.Model):
refund_security = fields.Integer(string='Refund Security', refund_security = fields.Integer(string='Refund Security',
help="Refund security password, used for " help="Refund security password, used for "
"that specified shop") "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

2
pos_refund_password/static/src/js/ticket_screen.js

@ -11,7 +11,7 @@ patch(TicketScreen.prototype, {
async onDoRefund() { async onDoRefund() {
var refund=""; var refund="";
var session_refund= false; 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; refund = data;
if (!refund){ if (!refund){
session_refund = this.pos.config.refund_security; session_refund = this.pos.config.refund_security;

Loading…
Cancel
Save