Update code to fix issue #erpnext WN-SUP25349 : ValueError: max() arg is an empty sequence. (#9025)

This commit is contained in:
Ashwini Save 2017-05-25 15:48:08 +05:30 committed by Nabin Hait
parent 45d337a016
commit d702cbfbfa

View File

@ -19,7 +19,8 @@ class Asset(Document):
self.validate_asset_values() self.validate_asset_values()
self.make_depreciation_schedule() self.make_depreciation_schedule()
self.set_accumulated_depreciation() self.set_accumulated_depreciation()
self.validate_expected_value_after_useful_life() if self.get("schedules"):
self.validate_expected_value_after_useful_life()
# Validate depreciation related accounts # Validate depreciation related accounts
get_depreciation_accounts(self) get_depreciation_accounts(self)