fix!: Dont update modified by default in db.set_value (#18301)

This commit is contained in:
Ankush Menat 2022-10-06 16:01:20 +05:30 committed by GitHub
parent 6ed3ce5875
commit 6aaefd6633
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View file

@ -841,7 +841,7 @@ class Database:
val=None,
modified=None,
modified_by=None,
update_modified=True,
update_modified=False,
debug=False,
for_update=True,
):

View file

@ -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

View file

@ -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),