fix: version diff for empty datetime fields (#33605)
* fix: version diff for empty datetime fields * fix: remove debug print
This commit is contained in:
parent
acb7f82732
commit
6e880bdcfe
1 changed files with 5 additions and 1 deletions
|
|
@ -4,7 +4,7 @@
|
|||
import json
|
||||
|
||||
import frappe
|
||||
from frappe.model import no_value_fields, table_fields
|
||||
from frappe.model import datetime_fields, no_value_fields, table_fields
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import cstr
|
||||
|
||||
|
|
@ -120,6 +120,10 @@ def get_diff(old, new, for_child=False, compare_cancelled=False):
|
|||
if df.fieldtype in ("Link", "Dynamic Link"):
|
||||
old_value, new_value = cstr(old_value), cstr(new_value)
|
||||
|
||||
if df.fieldtype in datetime_fields:
|
||||
if old_value is None and new_value == "":
|
||||
new_value = None
|
||||
|
||||
if not for_child and df.fieldtype in table_fields:
|
||||
old_rows_by_name = {}
|
||||
for d in old_value:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue