Skip to content

Commit

Permalink
fix: Cannot read properties of undefined (reading 'rate')
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitwaghchaure committed Mar 20, 2024
1 parent 6d47b8a commit ac92a22
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions erpnext/public/js/controllers/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -1276,8 +1276,11 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe

calculate_stock_uom_rate(doc, cdt, cdn) {
let item = frappe.get_doc(cdt, cdn);
item.stock_uom_rate = flt(item.rate)/flt(item.conversion_factor);
refresh_field("stock_uom_rate", item.name, item.parentfield);

if (item?.rate) {
item.stock_uom_rate = flt(item.rate) / flt(item.conversion_factor);
refresh_field("stock_uom_rate", item.name, item.parentfield);
}
}
service_stop_date(frm, cdt, cdn) {
var child = locals[cdt][cdn];
Expand Down

0 comments on commit ac92a22

Please sign in to comment.