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. 36
      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', '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""", 'summary': """Restrict POS Refund with Password In Odoo 16""",
'description': """Restrict POS Refund with Password In Odoo 16""", 'description': """Restrict POS Refund with Password In Odoo 16""",
'category': 'Point of Sale', 'category': 'Point of Sale',

4
pos_refund_password/doc/RELEASE_NOTES.md

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

36
pos_refund_password/static/src/js/refund_password.js

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