From b162c0d6eced208bc737da8c985fff8ed205e9fd Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Wed, 11 Jun 2025 15:45:35 +0530 Subject: [PATCH] fix!: Don't update document from keyword args (#32898) Right now if you do this: `get_doc(doctype, name, field=value)` then it loads document from DB and then updates field to value. This is absurd API and I don't think it was ever done intentionally. --- frappe/model/document.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/frappe/model/document.py b/frappe/model/document.py index 7358f5634c..c5b7596efc 100644 --- a/frappe/model/document.py +++ b/frappe/model/document.py @@ -194,8 +194,6 @@ class Document(BaseDocument): # since it is used in virtual doctypes and inherited in child classes self.flags.for_update = kwargs.pop("for_update", None) self.load_from_db() - if kwargs: # ad-hoc overrides - self._init_from_kwargs(kwargs) def _init_dispatch(self, arg, *args, **kwargs): if isinstance(arg, str):