fix: Cannot read properties of undefined (reading 'rate')

This commit is contained in:
Rohit Waghchaure
2024-03-20 14:56:07 +05:30
parent 6d47b8a24e
commit ac92a22914

View File

@@ -1276,9 +1276,12 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
calculate_stock_uom_rate(doc, cdt, cdn) {
let item = frappe.get_doc(cdt, cdn);
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];