|
@@ -132,7 +132,6 @@ class BaseDocument(object): |
|
|
|
|
|
|
|
|
# reference parent document |
|
|
# reference parent document |
|
|
value.parent_doc = self |
|
|
value.parent_doc = self |
|
|
value.docstatus = 0 |
|
|
|
|
|
return value |
|
|
return value |
|
|
else: |
|
|
else: |
|
|
raise ValueError, "Document attached to child table must be a dict or BaseDocument, not " + str(type(value))[1:-1] |
|
|
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.parent = self.name |
|
|
value.parenttype = self.doctype |
|
|
value.parenttype = self.doctype |
|
|
value.parentfield = key |
|
|
value.parentfield = key |
|
|
|
|
|
value.docstatus = 0 |
|
|
|
|
|
|
|
|
if not getattr(value, "idx", None): |
|
|
if not getattr(value, "idx", None): |
|
|
value.idx = len(self.get(key) or []) + 1 |
|
|
value.idx = len(self.get(key) or []) + 1 |
|
|