Merge pull request #33172 from sagarvora/perf-copy_doc
This commit is contained in:
commit
2e310c97b1
1 changed files with 1 additions and 1 deletions
|
|
@ -1602,7 +1602,7 @@ def copy_doc(doc: "Document", ignore_no_copy: bool = True) -> "Document":
|
|||
if not in_test:
|
||||
fields_to_clear.append("docstatus")
|
||||
|
||||
if isinstance(doc, BaseDocument) or hasattr(doc, "as_dict"):
|
||||
if isinstance(doc, BaseDocument):
|
||||
d = doc.as_dict()
|
||||
elif isinstance(doc, MappingProxyType): # global test record
|
||||
d = dict(doc)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue