fix(Asset Repair): Display fields according to the state of the doc
diff --git a/erpnext/assets/doctype/asset_repair/asset_repair.js b/erpnext/assets/doctype/asset_repair/asset_repair.js
index 7633a59..fdb8d0a 100644
--- a/erpnext/assets/doctype/asset_repair/asset_repair.js
+++ b/erpnext/assets/doctype/asset_repair/asset_repair.js
@@ -3,8 +3,6 @@
frappe.ui.form.on('Asset Repair', {
refresh: function(frm) {
- frm.toggle_display(['completion_date', 'repair_status', 'accounting_details', 'accounting_dimensions_section'], !(frm.doc.__islocal));
-
if (frm.doc.docstatus) {
frm.add_custom_button("View General Ledger", function() {
frappe.route_options = {
diff --git a/erpnext/assets/doctype/asset_repair/asset_repair.json b/erpnext/assets/doctype/asset_repair/asset_repair.json
index 1a714a7..c2780a1 100644
--- a/erpnext/assets/doctype/asset_repair/asset_repair.json
+++ b/erpnext/assets/doctype/asset_repair/asset_repair.json
@@ -71,6 +71,7 @@
},
{
"allow_on_submit": 1,
+ "depends_on": "eval:!doc.__islocal",
"fieldname": "completion_date",
"fieldtype": "Datetime",
"label": "Completion Date"
@@ -78,6 +79,7 @@
{
"allow_on_submit": 1,
"default": "Pending",
+ "depends_on": "eval:!doc.__islocal",
"fieldname": "repair_status",
"fieldtype": "Select",
"label": "Repair Status",
@@ -154,6 +156,7 @@
},
{
"default": "0",
+ "depends_on": "eval:!doc.__islocal",
"fieldname": "capitalize_repair_cost",
"fieldtype": "Check",
"label": "Capitalize Repair Cost"
@@ -197,6 +200,7 @@
},
{
"default": "0",
+ "depends_on": "eval:!doc.__islocal",
"fieldname": "stock_consumption",
"fieldtype": "Check",
"label": "Stock Consumed During Repair"
@@ -231,6 +235,7 @@
"label": "Increase In Asset Life(Months)"
},
{
+ "depends_on": "eval:!doc.__islocal",
"fieldname": "purchase_invoice",
"fieldtype": "Link",
"label": "Purchase Invoice",
@@ -240,8 +245,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
- "modified": "2021-06-15 10:34:00.839353",
- "title_field": "asset_name",
+ "modified": "2021-06-16 07:01:28.217619",
"modified_by": "Administrator",
"module": "Assets",
"name": "Asset Repair",
@@ -280,6 +284,7 @@
],
"sort_field": "modified",
"sort_order": "DESC",
+ "title_field": "asset_name",
"track_changes": 1,
"track_seen": 1
}
\ No newline at end of file