mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-19 01:18:43 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user