Merge pull request #26976 from resilient-tech/fix-incorrect-modified

fix: Incorrect `modified` time in documents that inherit from `StatusUpdater`
This commit is contained in:
Sagar Vora 2021-08-17 13:17:09 +05:30 committed by GitHub
parent 972da750bc
commit d932cba38a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, comma_or, nowdate, getdate
from frappe.utils import flt, comma_or, nowdate, getdate, now
from frappe import _
from frappe.model.document import Document
@ -336,10 +336,14 @@ class StatusUpdater(Document):
target.notify_update()
def _update_modified(self, args, update_modified):
args['update_modified'] = ''
if update_modified:
args['update_modified'] = ', modified = now(), modified_by = {0}'\
.format(frappe.db.escape(frappe.session.user))
if not update_modified:
args['update_modified'] = ''
return
args['update_modified'] = ', modified = {0}, modified_by = {1}'.format(
frappe.db.escape(now()),
frappe.db.escape(frappe.session.user)
)
def update_billing_status_for_zero_amount_refdoc(self, ref_dt):
ref_fieldname = frappe.scrub(ref_dt)