Browse Source

Sep 6 [FIX] : Bug Fixed 'pos_refund_password'

pull/277/head
AjmalCybro 2 years ago
parent
commit
517b716444
  1. 2
      pos_refund_password/__manifest__.py
  2. 4
      pos_refund_password/doc/RELEASE_NOTES.md
  3. 38
      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.1',
'version': '16.0.1.0.2',
'summary': """Restrict POS Refund with Password In Odoo 16""",
'description': """Restrict POS Refund with Password In Odoo 16""",
'category': 'Point of Sale',

4
pos_refund_password/doc/RELEASE_NOTES.md

@ -8,3 +8,7 @@
#### Version 16.0.1.0.1
#### FIX
- Fixed the undeclared body
- #### 06.09.2023
#### Version 16.0.1.0.2
#### FIX
- Fixed the refund password issue

38
pos_refund_password/static/src/js/refund_password.js

@ -11,6 +11,7 @@ odoo.define('pos_refund_password.RefundPasswordButton', function (require) {
class extends TicketScreen {
async _onDoRefund() {
var refund="";
var session_refund= false;
var data = await rpc.query({
model: 'ir.config_parameter',
method: 'get_param',
@ -23,19 +24,34 @@ odoo.define('pos_refund_password.RefundPasswordButton', function (require) {
'Incorrect Password')
};
if (!refund){
refund=this.env.pos.config.refund_security; }
const { confirmed, payload } = await this.showPopup('NumberPopup')
if(refund == payload)
{
super._onDoRefund();
session_refund = this.env.pos.config.refund_security;
}
if(refund){
const { confirmed, payload } = await this.showPopup('NumberPopup')
if(refund == payload){
super._onDoRefund();
}
else{
this.showPopup('ErrorPopup',{
body : this.env._t('Invalid Password, Enter your global password'),
});
}
}
else{
this.showPopup('ErrorPopup',{
body : this.env._t('Invalid Password'),
});
else if(session_refund){
const { confirmed, payload } = await this.showPopup('NumberPopup')
if(session_refund == payload){
super._onDoRefund();
}
else{
this.showPopup('ErrorPopup',{
body : this.env._t('Incorrect Password'),
});
}
}
else{
super._onDoRefund();
}
}
};
Registries.Component.extend(TicketScreen, PosResTicketScreen1);
});
});
Loading…
Cancel
Save