fix: handle JSON content in run_doc_method

(cherry picked from commit d130a91d9c5d9158fb78563f5a20145a356d07f0)
This commit is contained in:
barredterra 2021-08-12 14:38:33 +02:00 committed by mergify-bot
parent 899148072a
commit a5a4f33644

View file

@ -223,7 +223,10 @@ def run_doc_method(method, docs=None, dt=None, dn=None, arg=None, args=None):
doc = frappe.get_doc(dt, dn)
else:
doc = frappe.get_doc(json.loads(docs))
if isinstance(docs, str):
docs = json.loads(docs)
doc = frappe.get_doc(docs)
doc._original_modified = doc.modified
doc.check_if_latest()