From eb9c558cf0f08986fb3261b2f47cb0ef35acd9d9 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 18 Jun 2014 15:26:40 +0530 Subject: [PATCH] hotfix: dont_update_if_missing --- frappe/model/document.py | 3 +++ 1 file changed, 3 insertions(+) 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))