From 3525481823428aeaee0c51992a8220ff9ac343fd Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 5 Jul 2013 11:27:26 +0530 Subject: [PATCH 1/2] [patch] restore defaults --- patches/july_2013/__init__.py | 0 patches/july_2013/restore_tree_roots.py | 3 +++ startup/install.py | 6 +++--- 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 patches/july_2013/__init__.py create mode 100644 patches/july_2013/restore_tree_roots.py diff --git a/patches/july_2013/__init__.py b/patches/july_2013/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/patches/july_2013/restore_tree_roots.py b/patches/july_2013/restore_tree_roots.py new file mode 100644 index 00000000000..ea3a9913ea2 --- /dev/null +++ b/patches/july_2013/restore_tree_roots.py @@ -0,0 +1,3 @@ +def execute(): + from startup.install import import_defaults + import_defaults() \ No newline at end of file diff --git a/startup/install.py b/startup/install.py index 5ddbf094c82..1553e1b72fc 100644 --- a/startup/install.py +++ b/startup/install.py @@ -176,6 +176,6 @@ def import_defaults(): ] for r in records: - doc = webnotes.doc(r) - doc.insert() - \ No newline at end of file + if not webnotes.conn.exists(r['doctype'], r['name']): + bean = webnotes.bean(r) + bean.insert() \ No newline at end of file From 00d344b93459a48f119aac992f195981dbdc7c2b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 5 Jul 2013 11:32:18 +0530 Subject: [PATCH 2/2] [fixes] default records while install --- startup/install.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/startup/install.py b/startup/install.py index 1553e1b72fc..204df87913f 100644 --- a/startup/install.py +++ b/startup/install.py @@ -139,8 +139,10 @@ def import_defaults(): {'doctype': 'Supplier Type', 'name': 'Default Supplier Type', 'supplier_type': 'Default Supplier Type'}, # Price List - {'doctype': 'Price List', 'name': 'Default Price List', 'price_list_name': 'Default Price List'}, - {'doctype': 'Price List', 'name': 'Standard', 'price_list_name': 'Standard'}, + {'doctype': 'Price List', 'name': 'Default Price List', + 'price_list_name': 'Default Price List', "valid_for_all_countries": 1}, + {'doctype': 'Price List', 'name': 'Standard', 'price_list_name': 'Standard', + "valid_for_all_countries": 1}, # warehouse type {'doctype': 'Warehouse Type', 'name': 'Default Warehouse Type', 'warehouse_type': 'Default Warehouse Type'},