Bläddra i källkod

[minor] moved docstatus=0 to init child

version-14
Anand Doshi 10 år sedan
förälder
incheckning
d85cc02b03
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. +1
    -1
      frappe/model/base_document.py

+ 1
- 1
frappe/model/base_document.py Visa fil

@@ -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


Laddar…
Avbryt
Spara