From 6aaefd66337b2850cf1f7b9a45cbe394467cffb9 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Thu, 6 Oct 2022 16:01:20 +0530 Subject: [PATCH] fix!: Dont update modified by default in db.set_value (#18301) --- frappe/database/database.py | 2 +- frappe/model/document.py | 2 +- frappe/tests/test_db.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frappe/database/database.py b/frappe/database/database.py index 5c60088bc9..b2989e5879 100644 --- a/frappe/database/database.py +++ b/frappe/database/database.py @@ -841,7 +841,7 @@ class Database: val=None, modified=None, modified_by=None, - update_modified=True, + update_modified=False, debug=False, for_update=True, ): diff --git a/frappe/model/document.py b/frappe/model/document.py index ea965151eb..cf438525dd 100644 --- a/frappe/model/document.py +++ b/frappe/model/document.py @@ -1144,7 +1144,7 @@ class Document(BaseDocument): data = {"doctype": self.doctype, "name": self.name, "user": frappe.session.user} frappe.publish_realtime("list_update", data, after_commit=True) - def db_set(self, fieldname, value=None, update_modified=True, notify=False, commit=False): + def db_set(self, fieldname, value=None, update_modified=False, notify=False, commit=False): """Set a value in the document object, update the timestamp and update the database. WARNING: This method does not trigger controller validations and should diff --git a/frappe/tests/test_db.py b/frappe/tests/test_db.py index f4965bb5a9..165d877e3c 100644 --- a/frappe/tests/test_db.py +++ b/frappe/tests/test_db.py @@ -728,6 +728,7 @@ class TestDBSetValue(FrappeTestCase): "test_set_value change 1", modified=custom_modified, modified_by=custom_modified_by, + update_modified=True, ) self.assertTupleEqual( (custom_modified, custom_modified_by),