[hotfix] docstatus should be 0 if None

This commit is contained in:
Anand Doshi 2015-08-03 16:04:19 +05:30
parent 3e7e8cdd48
commit 7e1f08d64c

View file

@ -160,7 +160,9 @@ class BaseDocument(object):
value.parent = self.name
value.parenttype = self.doctype
value.parentfield = key
value.docstatus = 0
if value.docstatus is None:
value.docstatus = 0
if not getattr(value, "idx", None):
value.idx = len(self.get(key) or []) + 1