-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add option to update modified timestamp #29174
Conversation
This should be per-doctype and not system settings. See gameplan's implementation of this. https://github.com/frappe/gameplan/blob/605e73d1db4908554f3e4bd60a96787d6c8dc081/gameplan/gameplan/doctype/gp_discussion/gp_discussion.json#L69
This is no different than ERPNext having a separate |
@@ -59,6 +59,10 @@ def after_insert(self): | |||
notify_mentions(self.reference_doctype, self.reference_name, self.content) | |||
self.notify_change("add") | |||
|
|||
# update modified timestamp of reference document | |||
if frappe.db.get_single_value("System Settings", "update_timestamp_on_new_comment"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note: Use frappe.get_system_settings
(it's cached by default)
@@ -59,6 +59,10 @@ def after_insert(self): | |||
notify_mentions(self.reference_doctype, self.reference_name, self.content) | |||
self.notify_change("add") | |||
|
|||
# update modified timestamp of reference document | |||
if frappe.db.get_single_value("System Settings", "update_timestamp_on_new_comment"): | |||
frappe.get_doc(self.reference_doctype, self.reference_name).update_modified() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Entire doc shouldn't be fetched to update one field.
@iamejaaz can you discuss with @shariquerik and think of CRM specific fix? |
Also, these kinds of weird settings will get out of hand very quickly, are you really gonna recommend anyone who wants this behavior to toggle it from system settings? If it's worth having then it should be worth having by default in CRM. |
Closes frappe/erpnext#44330 and frappe/crm#492
frappe/erpnext#43968
no-docs