Skip to content

Commit

Permalink
fix: Cannot read properties of undefined (reading 'price_list_rate') …
Browse files Browse the repository at this point in the history
…(backport #43376) (#43377)

fix: Cannot read properties of undefined (reading 'price_list_rate') (#43376)

(cherry picked from commit a63dca0)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
  • Loading branch information
mergify[bot] and rohitwaghchaure committed Sep 25, 2024
1 parent 40fbb1d commit 47f06dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion erpnext/public/js/controllers/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 47f06dc

Please sign in to comment.