From 1c47e262ae0cecca49a76457a0ce53b1b080c959 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 7 Apr 2026 17:01:30 +0530 Subject: [PATCH] feat: do not round fields --- frappe/model/document.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frappe/model/document.py b/frappe/model/document.py index 23023b2f86..f959331d81 100644 --- a/frappe/model/document.py +++ b/frappe/model/document.py @@ -1766,7 +1766,7 @@ class Document(BaseDocument): _("Table {0} cannot be empty").format(label), raise_exception or frappe.EmptyTableError ) - def round_floats_in(self, doc, fieldnames=None): + def round_floats_in(self, doc, fieldnames=None, do_not_round_fields=None): """Round floats for all `Currency`, `Float`, `Percent` fields for the given doc. :param doc: Document whose numeric properties are to be rounded. @@ -1780,6 +1780,9 @@ class Document(BaseDocument): # PERF: flt internally has to resolve this if we don't specify it. rounding_method = frappe.get_system_settings("rounding_method") for fieldname in fieldnames: + if do_not_round_fields and fieldname in do_not_round_fields: + continue + doc.set( fieldname, flt(