Browse Source

Mar 28 : [UPDT] Bug Fixed 'pos_refund_password'

dependabot/npm_and_yarn/odoo_website_helpdesk/static/src/cdn/minimist-1.2.8
AjmalCybro 2 years ago
parent
commit
f10576f915
  1. 2
      pos_refund_password/__manifest__.py
  2. 6
      pos_refund_password/doc/RELEASE_NOTES.md
  3. 3
      pos_refund_password/model/refund_password.py
  4. 20
      pos_refund_password/static/src/js/refund_password.js

2
pos_refund_password/__manifest__.py

@ -21,7 +21,7 @@
#############################################################################
{
'name': 'Restrict POS Refund with Password In Odoo 16',
'version': '16.0.1.0.0',
'version': '16.0.1.0.1',
'summary': """Restrict POS Refund with Password In Odoo 16""",
'description': """Restrict POS Refund with Password In Odoo 16""",
'category': 'Point of Sale',

6
pos_refund_password/doc/RELEASE_NOTES.md

@ -3,4 +3,8 @@
#### 30.12.2022
#### Version 16.0.1.0.0
#### ADD
- Initial commit for pos_refund_password odoo
- Initial commit for pos_refund_password odoo
#### 28.03.2023
#### Version 16.0.1.0.1
#### FIX
- Fixed the undeclared body

3
pos_refund_password/model/refund_password.py

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from odoo import models, fields, api
from odoo import models, fields
class PosConfig(models.Model):
@ -15,3 +15,4 @@ class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
global_refund_security = fields.Integer(string='Global Refund Security',config_parameter='pos_refund_password.global_refund_security')

20
pos_refund_password/static/src/js/refund_password.js

@ -1,6 +1,5 @@
odoo.define('pos_refund_password.RefundPasswordButton', function (require) {
'use strict';
const PosComponent = require('point_of_sale.PosComponent');
const ProductScreen = require('point_of_sale.ProductScreen');
const Registries = require('point_of_sale.Registries');
@ -8,7 +7,6 @@ odoo.define('pos_refund_password.RefundPasswordButton', function (require) {
const TicketScreen = require('point_of_sale.TicketScreen');
const rpc = require("web.rpc");
const PosResTicketScreen1 = (TicketScreen) =>
class extends TicketScreen {
async _onDoRefund() {
@ -20,25 +18,21 @@ odoo.define('pos_refund_password.RefundPasswordButton', function (require) {
}).then(result =>{
refund = result;
});
body = this.env._t(
const dialogProps = {
body : this.env._t(
'Incorrect Password')
};
if (!refund){
refund=this.env.pos.config.refund_security;
}
refund=this.env.pos.config.refund_security; }
const { confirmed, payload } = await this.showPopup('NumberPopup')
if(refund == payload)
{
super._onDoRefund();
}
else{
this.showPopup('ErrorPopup',{body:body
})
body = this.env._t(
'Invalid Password')
this.showPopup('ErrorPopup',{
body : this.env._t('Invalid Password'),
});
}
}

Loading…
Cancel
Save