feat(Asset): Add 'Asset Value' field

This commit is contained in:
GangaManoj 2021-05-11 23:56:34 +05:30
parent 194a08e4ec
commit 6d1cf76b77
2 changed files with 11 additions and 1 deletions

View File

@ -23,6 +23,7 @@
"asset_name",
"asset_category",
"location",
"asset_value",
"custodian",
"department",
"disposal_date",
@ -480,6 +481,12 @@
"fieldname": "section_break_36",
"fieldtype": "Section Break",
"label": "Finance Books"
},
{
"fieldname": "asset_value",
"fieldtype": "Currency",
"label": "Asset Value",
"read_only": 1
}
],
"idx": 72,
@ -502,7 +509,7 @@
"link_fieldname": "asset"
}
],
"modified": "2021-01-22 12:38:59.091510",
"modified": "2021-05-11 23:47:15.831720",
"modified_by": "Administrator",
"module": "Assets",
"name": "Asset",

View File

@ -96,6 +96,9 @@ class Asset(AccountsController):
finance_books = get_item_details(self.item_code, self.asset_category)
self.set('finance_books', finance_books)
if not(self.asset_value):
self.asset_value = self.gross_purchase_amount
def validate_asset_values(self):
if not self.asset_category:
self.asset_category = frappe.get_cached_value("Item", self.item_code, "asset_category")