From d85cc02b03583c44b7e349f92035da4682d35a22 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 30 Jul 2015 16:36:10 +0530 Subject: [PATCH] [minor] moved docstatus=0 to init child --- frappe/model/base_document.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/model/base_document.py b/frappe/model/base_document.py index a45fa08ce6..c34b753cd1 100644 --- a/frappe/model/base_document.py +++ b/frappe/model/base_document.py @@ -132,7 +132,6 @@ class BaseDocument(object): # reference parent document value.parent_doc = self - value.docstatus = 0 return value else: raise ValueError, "Document attached to child table must be a dict or BaseDocument, not " + str(type(value))[1:-1] @@ -161,6 +160,7 @@ class BaseDocument(object): value.parent = self.name value.parenttype = self.doctype value.parentfield = key + value.docstatus = 0 if not getattr(value, "idx", None): value.idx = len(self.get(key) or []) + 1