From 47f06dc180ee434ce21eea9587fa43bb20079215 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2024 10:09:17 +0530 Subject: [PATCH] fix: Cannot read properties of undefined (reading 'price_list_rate') (backport #43376) (#43377) fix: Cannot read properties of undefined (reading 'price_list_rate') (#43376) (cherry picked from commit a63dca098452e46239878eb90d18a8f4ffeb3d16) Co-authored-by: rohitwaghchaure --- erpnext/public/js/controllers/transaction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 67c61118952b..204c09299ad7 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -1102,7 +1102,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe apply_discount_on_item(doc, cdt, cdn, field) { var item = frappe.get_doc(cdt, cdn); - if(!item.price_list_rate) { + if(!item?.price_list_rate) { item[field] = 0.0; } else { this.price_list_rate(doc, cdt, cdn);