refactor: parse native JSON request args in assets/doctype/asset/asset.py

Use frappe.parse_json instead of json.loads so the whitelisted endpoints
accept native JSON types (list/dict/bool) in addition to JSON strings.
This commit is contained in:
Mihir Kandoi
2026-06-24 20:37:31 +05:30
parent 0e862d61d1
commit 97f128791c

View File

@@ -995,8 +995,7 @@ class Asset(AccountsController):
@frappe.whitelist()
def get_depreciation_rate(self, args: str | dict | Document, on_validate: bool = False):
if isinstance(args, str):
args = json.loads(args)
args = frappe.parse_json(args)
rate_field_precision = frappe.get_single_value("System Settings", "float_precision") or 2