From b145fe3b3e7d1e8faaffc29106bbd5784e06e9d1 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sun, 31 Jul 2022 19:12:14 +0530 Subject: [PATCH] fix(pos): validate product bundles while submitting pos invoice (backport #31615) (#31657) --- erpnext/accounts/doctype/pos_invoice/pos_invoice.py | 3 --- erpnext/selling/page/point_of_sale/pos_payment.js | 5 +++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice.py b/erpnext/accounts/doctype/pos_invoice/pos_invoice.py index 96975e9d116b..59c7c843edf7 100644 --- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.py +++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.py @@ -222,9 +222,6 @@ def validate_stock_availablility(self): allow_negative_stock = frappe.db.get_single_value("Stock Settings", "allow_negative_stock") for d in self.get("items"): - is_service_item = not (frappe.db.get_value("Item", d.get("item_code"), "is_stock_item")) - if is_service_item: - return if d.serial_no: self.validate_pos_reserved_serial_nos(d) self.validate_delivered_serial_nos(d) diff --git a/erpnext/selling/page/point_of_sale/pos_payment.js b/erpnext/selling/page/point_of_sale/pos_payment.js index b4ece46e6e19..539a0278e2f8 100644 --- a/erpnext/selling/page/point_of_sale/pos_payment.js +++ b/erpnext/selling/page/point_of_sale/pos_payment.js @@ -161,13 +161,14 @@ erpnext.PointOfSale.Payment = class { frappe.ui.form.on('POS Invoice', 'contact_mobile', (frm) => { const contact = frm.doc.contact_mobile; + if (!this.request_for_payment_field) return; const request_button = $(this.request_for_payment_field.$input[0]); if (contact) { request_button.removeClass('btn-default').addClass('btn-primary'); } else { request_button.removeClass('btn-primary').addClass('btn-default'); - } - }); + } + }); frappe.ui.form.on('POS Invoice', 'coupon_code', (frm) => { if (frm.doc.coupon_code && !frm.applying_pos_coupon_code) {