Skip to content

Commit

Permalink
fix: make rate of depreciation mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
khushi8112 committed Dec 17, 2024
1 parent 632a45d commit ed42ed0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions erpnext/assets/doctype/asset/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,10 +804,10 @@ def get_depreciation_rate(self, args, on_validate=False):
):
return args.get("rate_of_depreciation")

if self.flags.increase_in_asset_value_due_to_repair:
if not flt(args.get("expected_value_after_useful_life")):
return args.get("rate_of_depreciation")
if args.get("rate_of_depreciation") and not flt(args.get("expected_value_after_useful_life")):
return args.get("rate_of_depreciation")

if self.flags.increase_in_asset_value_due_to_repair:
value = flt(args.get("expected_value_after_useful_life")) / flt(
args.get("value_after_depreciation")
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
"description": "In Percentage",
"fieldname": "rate_of_depreciation",
"fieldtype": "Percent",
"label": "Rate of Depreciation"
"label": "Rate of Depreciation (%)",
"mandatory_depends_on": "eval:doc.depreciation_method == 'Written Down Value'"
},
{
"fieldname": "salvage_value_percentage",
Expand Down Expand Up @@ -117,7 +118,7 @@
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2024-05-21 15:48:20.907250",
"modified": "2024-12-13 12:11:03.743209",
"modified_by": "Administrator",
"module": "Assets",
"name": "Asset Finance Book",
Expand Down

0 comments on commit ed42ed0

Please sign in to comment.