hotfix: dont_update_if_missing

This commit is contained in:
Anand Doshi 2014-06-18 15:26:40 +05:30
parent dcbfb5dae1
commit eb9c558cf0

View file

@ -48,6 +48,7 @@ def get_controller(doctype):
class Document(BaseDocument):
def __init__(self, arg1, arg2=None):
self.doctype = self.name = None
if arg1 and isinstance(arg1, basestring):
if not arg2:
# single
@ -72,6 +73,8 @@ class Document(BaseDocument):
# incorrect arguments. let's not proceed.
raise frappe.DataError("Document({0}, {1})".format(arg1, arg2))
self.dont_update_if_missing = []
def load_from_db(self):
if not getattr(self, "_metaclass", False) and self.meta.issingle:
self.update(frappe.db.get_singles_dict(self.doctype))