feat(Asset Repair): Add 'Accounting Dimensions' section

This commit is contained in:
GangaManoj 2021-05-12 21:06:20 +05:30
parent e5ab5d8963
commit f5a2ea9cb3
3 changed files with 28 additions and 5 deletions

View File

@ -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) => {

View File

@ -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",

View File

@ -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):