fix: add server side validation

This commit is contained in:
khushi8112
2025-12-18 17:34:31 +05:30
parent e2ac7646e6
commit e04353fc31

View File

@@ -243,6 +243,10 @@ class Asset(AccountsController):
self.validate_expected_value_after_useful_life()
self.set_total_booked_depreciations()
def before_submit(self):
if self.is_composite_asset and not has_active_capitalization(self.name):
frappe.throw(_("Please capitalize this asset before submitting."))
def on_submit(self):
self.validate_in_use_date()
self.make_asset_movement()