diff --git a/frappe/model/document.py b/frappe/model/document.py index 537b200fcb..fa7add577d 100644 --- a/frappe/model/document.py +++ b/frappe/model/document.py @@ -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))