From 25ccd1acbb87d679f646e5f0e662a8302581ca90 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 26 Apr 2018 12:09:33 +0530 Subject: [PATCH] minor fix in asset --- erpnext/assets/doctype/asset/asset.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/assets/doctype/asset/asset.py b/erpnext/assets/doctype/asset/asset.py index cb14484916..baffdd757d 100644 --- a/erpnext/assets/doctype/asset/asset.py +++ b/erpnext/assets/doctype/asset/asset.py @@ -52,15 +52,15 @@ class Asset(Document): self.set(field, value) def validate_asset_values(self): - if flt(self.expected_value_after_useful_life) >= flt(self.gross_purchase_amount): - frappe.throw(_("Expected Value After Useful Life must be less than Gross Purchase Amount")) - if not flt(self.gross_purchase_amount): frappe.throw(_("Gross Purchase Amount is mandatory"), frappe.MandatoryError) if not self.calculate_depreciation: return + if flt(self.expected_value_after_useful_life) >= flt(self.gross_purchase_amount): + frappe.throw(_("Expected Value After Useful Life must be less than Gross Purchase Amount")) + if not self.is_existing_asset: self.opening_accumulated_depreciation = 0 self.number_of_depreciations_booked = 0