From 7fe35a2d3cd2b698374842503781fdaa354187d4 Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Mon, 23 Sep 2019 15:54:46 +0530 Subject: [PATCH] fix: set default value in set_value as None to avoid error. ``` frappe.db.set_value('Call Log', log.name, { fieldname: doc.name, display_name_field: doc.get_title() }, update_modified=False) ``` this code should not fail if value is not pass because value is passed in the dict. --- frappe/database/database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/database/database.py b/frappe/database/database.py index 412051c76f..a1b8d390a9 100644 --- a/frappe/database/database.py +++ b/frappe/database/database.py @@ -607,7 +607,7 @@ class Database(object): """Update multiple values. Alias for `set_value`.""" return self.set_value(*args, **kwargs) - def set_value(self, dt, dn, field, val, modified=None, modified_by=None, + def set_value(self, dt, dn, field, val=None, modified=None, modified_by=None, update_modified=True, debug=False): """Set a single value in the database, do not call the ORM triggers but update the modified timestamp (unless specified not to).