mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 14:39:19 +00:00
Merge pull request #55142 from khushi8112/composite-asset-net-purchase-amount-reset
fix: don't reset net_purchase_amount for Composite Asset if already set
This commit is contained in:
@@ -551,7 +551,9 @@ frappe.ui.form.on("Asset", {
|
|||||||
asset_type: function (frm) {
|
asset_type: function (frm) {
|
||||||
if (frm.doc.docstatus == 0) {
|
if (frm.doc.docstatus == 0) {
|
||||||
if (frm.doc.asset_type == "Composite Asset") {
|
if (frm.doc.asset_type == "Composite Asset") {
|
||||||
frm.set_value("net_purchase_amount", 0);
|
if (!frm.doc.net_purchase_amount) {
|
||||||
|
frm.set_value("net_purchase_amount", 0);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
frm.set_df_property("net_purchase_amount", "read_only", 0);
|
frm.set_df_property("net_purchase_amount", "read_only", 0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user