Browse Source

Aug 29: [FIX] Bug Fixed 'pos_partial_payment_odoo'

pull/331/head
Cybrosys Technologies 8 months ago
parent
commit
80d7f83678
  1. 2
      pos_partial_payment_odoo/__manifest__.py
  2. 8
      pos_partial_payment_odoo/doc/RELEASE_NOTES.md
  3. 7
      pos_partial_payment_odoo/static/src/js/payment_screen.js
  4. 2
      pos_partial_payment_odoo/static/src/xml/payment_screen.xml

2
pos_partial_payment_odoo/__manifest__.py

@ -21,7 +21,7 @@
################################################################################ ################################################################################
{ {
'name': 'POS Partial Payment', 'name': 'POS Partial Payment',
'version': '17.0.1.0.0', 'version': '17.0.1.0.1',
'category': 'Point of Sale', 'category': 'Point of Sale',
'summary': "Simplify Payments with Partial Payment in Odoo POS", 'summary': "Simplify Payments with Partial Payment in Odoo POS",
'description': "In Odoo POS, partial payments allow customers to pay for " 'description': "In Odoo POS, partial payments allow customers to pay for "

8
pos_partial_payment_odoo/doc/RELEASE_NOTES.md

@ -5,3 +5,11 @@
### ADD ### ADD
- Initial Commit for POS Partial Payment - Initial Commit for POS Partial Payment
## Module <pos_partial_payment_odoo>
#### 23.08.2024
#### Version 17.0.1.0.1
#### UPDT
- Update the xml and js file with proper useRef.

7
pos_partial_payment_odoo/static/src/js/payment_screen.js

@ -11,6 +11,7 @@ patch(PaymentScreen.prototype, {
setup() { setup() {
super.setup(...arguments); super.setup(...arguments);
this.root = useRef('PartialPayment'); this.root = useRef('PartialPayment');
this.button = useRef('PartialPaymentButton');
}, },
//Partial Payment Button Functionality //Partial Payment Button Functionality
PartialPaymentButton() { PartialPaymentButton() {
@ -21,13 +22,15 @@ patch(PaymentScreen.prototype, {
}); });
return false; return false;
}; };
console.log(this.root.el, "this.root.el")
console.log(this.button, "this.root.el")
if (this.currentOrder.partial_payment === true) { if (this.currentOrder.partial_payment === true) {
this.currentOrder.partial_payment = false; this.currentOrder.partial_payment = false;
var validate = this.root.el var validate = this.root.el || this.button.el
validate.classList.add('disabled'); validate.classList.add('disabled');
} else if(this.currentOrder.get_partner()){ } else if(this.currentOrder.get_partner()){
this.currentOrder.partial_payment = true; this.currentOrder.partial_payment = true;
var validate = this.root.el var validate = this.root.el || this.button.el
validate.classList.remove('disabled'); validate.classList.remove('disabled');
} }
}, },

2
pos_partial_payment_odoo/static/src/xml/payment_screen.xml

@ -6,7 +6,7 @@
<xpath expr="//button[hasclass('js_invoice')]" position="after"> <xpath expr="//button[hasclass('js_invoice')]" position="after">
<t t-if="pos.config.partial_payment"> <t t-if="pos.config.partial_payment">
<button class="button btn btn-light py-3 text-start rounded-0 border-bottom" <button class="button btn btn-light py-3 text-start rounded-0 border-bottom"
t-ref="" t-ref="PartialPaymentButton"
t-on-click="PartialPaymentButton" t-on-click="PartialPaymentButton"
t-att-class="{ 'highlight text-bg-primary': currentOrder.partial_payment }"> t-att-class="{ 'highlight text-bg-primary': currentOrder.partial_payment }">
<i class="fa fa-file-text-o me-2"/> <i class="fa fa-file-text-o me-2"/>

Loading…
Cancel
Save