Hi,
Getting error message when saving asset
“Expected value after useful life must be greater than or equal to 0.320000000997”
Asset value is 1,550, depreciation period is 48 months, so depreciation value is 1,550/48 = 32.29166667…
Seems depreciation value x 48 month would not result in 1,550. While the function below checks for the exact amount:
def validate_expected_value_after_useful_life(self):
accumulated_depreciation_after_full_schedule = \
max([d.accumulated_depreciation_amount for d in self.get("schedules")])
asset_value_after_full_schedule = (flt(self.gross_purchase_amount) -
flt(accumulated_depreciation_after_full_schedule))
if self.expected_value_after_useful_life < asset_value_after_full_schedule:
frappe.throw(_("Expected value after useful life must be greater than or equal to {0}")
.format(asset_value_after_full_schedule))