diff --git a/erpnext/assets/doctype/asset_repair/asset_repair.js b/erpnext/assets/doctype/asset_repair/asset_repair.js index 4641f3aaa2..d61cd83e3e 100644 --- a/erpnext/assets/doctype/asset_repair/asset_repair.js +++ b/erpnext/assets/doctype/asset_repair/asset_repair.js @@ -27,7 +27,7 @@ frappe.ui.form.on('Asset Repair', { // }, refresh: function(frm) { - frm.toggle_display(['completion_date', 'repair_status', 'accounting_details', 'stock_items_section'], !(frm.doc.__islocal)); + frm.toggle_display(['completion_date', 'repair_status', 'accounting_details', 'stock_items_section', 'accounting_dimensions_section'], !(frm.doc.__islocal)); }, repair_status: (frm) => { diff --git a/erpnext/assets/doctype/asset_repair/asset_repair.json b/erpnext/assets/doctype/asset_repair/asset_repair.json index a8a9f2d195..18bb2da658 100644 --- a/erpnext/assets/doctype/asset_repair/asset_repair.json +++ b/erpnext/assets/doctype/asset_repair/asset_repair.json @@ -18,6 +18,10 @@ "column_break_6", "completion_date", "repair_status", + "accounting_dimensions_section", + "cost_center", + "column_break_14", + "project", "accounting_details", "repair_cost", "capitalize_repair_cost", @@ -188,12 +192,33 @@ { "fieldname": "stock_items_section", "fieldtype": "Section Break" + }, + { + "fieldname": "accounting_dimensions_section", + "fieldtype": "Section Break", + "label": "Accounting Dimensions" + }, + { + "fieldname": "cost_center", + "fieldtype": "Link", + "label": "Cost Center", + "options": "Cost Center" + }, + { + "fieldname": "project", + "fieldtype": "Link", + "label": "Project", + "options": "Project" + }, + { + "fieldname": "column_break_14", + "fieldtype": "Column Break" } ], "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2021-05-12 04:45:38.714776", + "modified": "2021-05-12 21:03:59.032864", "modified_by": "Administrator", "module": "Assets", "name": "Asset Repair", diff --git a/erpnext/assets/doctype/asset_repair/asset_repair.py b/erpnext/assets/doctype/asset_repair/asset_repair.py index d34970d16d..e4cbabee36 100644 --- a/erpnext/assets/doctype/asset_repair/asset_repair.py +++ b/erpnext/assets/doctype/asset_repair/asset_repair.py @@ -41,9 +41,7 @@ class AssetRepair(Document): asset_value = frappe.db.get_value('Asset', self.asset, 'asset_value') + self.repair_cost for item in self.stock_items: asset_value += item.total_value - - print("*" * 20) - print(asset_value) + frappe.db.set_value('Asset', self.asset, 'asset_value', asset_value) def on_cancel(self):