Asset category mandatory validation while fetching item details

This commit is contained in:
Nabin Hait 2016-07-16 11:20:50 +05:30
parent 37dd714e6c
commit 94105b04b8

View File

@ -229,6 +229,9 @@ def transfer_asset(args):
def get_item_details(item_code):
asset_category = frappe.db.get_value("Item", item_code, "asset_category")
if not asset_category:
frappe.throw(_("Please enter Asset Category in Item {0}").format(item_code))
ret = frappe.db.get_value("Asset Category", asset_category,
["depreciation_method", "total_number_of_depreciations", "frequency_of_depreciation"], as_dict=1)