From a714b2d588954cd75d1769d421d5f43d4ea932a5 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 26 Jun 2014 14:47:43 +0530 Subject: [PATCH 1/2] Dont copy amended_from and amendment_date in copy_doc --- frappe/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frappe/__init__.py b/frappe/__init__.py index a1efef535d..e1bc821193 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -556,6 +556,8 @@ def copy_doc(doc): newdoc.set("__islocal", 1) newdoc.owner = None newdoc.creation = None + newdoc.amended_from = None + newdoc.amendment_date = None for d in newdoc.get_all_children(): d.name = None d.parent = None From df3a115d428a92fe82dba73ab1703d3560a582d2 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 26 Jun 2014 15:01:25 +0530 Subject: [PATCH 2/2] minor fix --- frappe/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/frappe/__init__.py b/frappe/__init__.py index e1bc821193..b302a749e7 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -545,6 +545,7 @@ def import_doc(path, ignore_links=False, ignore_insert=False, insert=False): data_import_tool.import_doc(path, ignore_links=ignore_links, ignore_insert=ignore_insert, insert=insert) def copy_doc(doc): + """ No_copy fields also get copied.""" import copy if not isinstance(doc, dict): d = doc.as_dict()