Merge pull request #26976 from resilient-tech/fix-incorrect-modified
fix: Incorrect `modified` time in documents that inherit from `StatusUpdater`
(cherry picked from commit d932cba38a)
This commit is contained in:
committed by
frappe-pr-bot
parent
133486a5c7
commit
6e921b1ccc
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
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 import _
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
@@ -336,10 +336,14 @@ class StatusUpdater(Document):
|
|||||||
target.notify_update()
|
target.notify_update()
|
||||||
|
|
||||||
def _update_modified(self, args, update_modified):
|
def _update_modified(self, args, update_modified):
|
||||||
|
if not update_modified:
|
||||||
args['update_modified'] = ''
|
args['update_modified'] = ''
|
||||||
if update_modified:
|
return
|
||||||
args['update_modified'] = ', modified = now(), modified_by = {0}'\
|
|
||||||
.format(frappe.db.escape(frappe.session.user))
|
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):
|
def update_billing_status_for_zero_amount_refdoc(self, ref_dt):
|
||||||
ref_fieldname = frappe.scrub(ref_dt)
|
ref_fieldname = frappe.scrub(ref_dt)
|
||||||
|
|||||||
Reference in New Issue
Block a user