fix: cannot save asset category withouut depr posting date

This commit is contained in:
Saqib
2021-01-04 11:48:45 +05:30
committed by GitHub
parent 945c0e86de
commit 40b37f09fd
3 changed files with 4 additions and 8 deletions

View File

@@ -136,6 +136,8 @@ frappe.ui.form.on('Asset', {
if (frm.doc.docstatus == 0) { if (frm.doc.docstatus == 0) {
frm.toggle_reqd("finance_books", frm.doc.calculate_depreciation); frm.toggle_reqd("finance_books", frm.doc.calculate_depreciation);
frm.set_df_property('depreciation_start_date', 'reqd', 1, frm.doc.name, 'finance_books');
frm.refresh_field('finance_books');
} }
}, },

View File

@@ -50,6 +50,5 @@ frappe.ui.form.on('Asset Category', {
} }
}; };
}); });
} }
}); });

View File

@@ -1,5 +1,4 @@
{ {
"actions": [],
"creation": "2018-05-08 14:44:37.095570", "creation": "2018-05-08 14:44:37.095570",
"doctype": "DocType", "doctype": "DocType",
"editable_grid": 1, "editable_grid": 1,
@@ -54,9 +53,7 @@
"fieldname": "depreciation_start_date", "fieldname": "depreciation_start_date",
"fieldtype": "Date", "fieldtype": "Date",
"in_list_view": 1, "in_list_view": 1,
"label": "Depreciation Posting Date", "label": "Depreciation Posting Date"
"mandatory_depends_on": "eval:parent.doctype == 'Asset'",
"reqd": 1
}, },
{ {
"default": "0", "default": "0",
@@ -84,10 +81,8 @@
"label": "Rate of Depreciation" "label": "Rate of Depreciation"
} }
], ],
"index_web_pages_for_search": 1,
"istable": 1, "istable": 1,
"links": [], "modified": "2020-12-30 15:43:03.188256",
"modified": "2020-10-30 15:22:29.119868",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Assets", "module": "Assets",
"name": "Asset Finance Book", "name": "Asset Finance Book",