From 8911a1daa8035446f3ecdec775daf873d7b896ce Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 6 Mar 2013 11:30:08 +0530 Subject: [PATCH] fixed patches for new sync --- conf/Framework.sql | 2 ++ webnotes/model/bean.py | 5 +++-- webnotes/modules/import_file.py | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/conf/Framework.sql b/conf/Framework.sql index 38c4636863..acb7b4c6c0 100644 --- a/conf/Framework.sql +++ b/conf/Framework.sql @@ -35,6 +35,7 @@ CREATE TABLE `tabDocField` ( `depends_on` varchar(180) DEFAULT NULL, `permlevel` int(11) DEFAULT '0', `width` varchar(180) DEFAULT NULL, + `print_width` varchar(180) DEFAULT NULL, `default` text, `description` text, `in_filter` int(1) DEFAULT NULL, @@ -120,6 +121,7 @@ CREATE TABLE `tabDocType` ( `allow_email` int(1) DEFAULT NULL, `allow_copy` int(1) DEFAULT NULL, `allow_rename` int(1) DEFAULT NULL, + `allow_import` int(1) DEFAULT NULL, `hide_toolbar` int(1) DEFAULT NULL, `hide_heading` int(1) DEFAULT NULL, `allow_attach` int(1) DEFAULT NULL, diff --git a/webnotes/model/bean.py b/webnotes/model/bean.py index 634ab77621..350e13d803 100644 --- a/webnotes/model/bean.py +++ b/webnotes/model/bean.py @@ -46,6 +46,7 @@ class Bean: self.ignore_children_type = [] self.ignore_check_links = False self.ignore_validate = False + self.ignore_fields = False if isinstance(dt, basestring) and not dn: dn = dt @@ -216,7 +217,7 @@ class Bean: def save_main(self): try: - self.doc.save(check_links = False) + self.doc.save(check_links = False, ignore_fields = self.ignore_fields) except NameError, e: webnotes.msgprint('%s "%s" already exists' % (self.doc.doctype, self.doc.name)) @@ -233,7 +234,7 @@ class Bean: d.parent = self.doc.name # rename if reqd d.parenttype = self.doc.doctype - d.save(check_links=False) + d.save(check_links=False, ignore_fields = self.ignore_fields) child_map.setdefault(d.doctype, []).append(d.name) diff --git a/webnotes/modules/import_file.py b/webnotes/modules/import_file.py index 8022c51c81..bab9cb94e3 100644 --- a/webnotes/modules/import_file.py +++ b/webnotes/modules/import_file.py @@ -103,6 +103,10 @@ def import_doclist(doclist): new_bean.ignore_children_type = ignore new_bean.ignore_check_links = True new_bean.ignore_validate = True + + if doctype=="DocType" and name in ["DocField", "DocType"]: + new_bean.ignore_fields = True + new_bean.insert() def remove_ignored_docs_if_they_already_exist(doclist, ignore, name):