From d3a8c9308bd536cfae8008d58eedd5d315a2d60b Mon Sep 17 00:00:00 2001 From: Saurabh Date: Tue, 29 May 2018 13:07:27 +0530 Subject: [PATCH] [fix] add ignore validate flag (#14238) --- .../v11_0/rename_supplier_type_to_supplier_group.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/erpnext/patches/v11_0/rename_supplier_type_to_supplier_group.py b/erpnext/patches/v11_0/rename_supplier_type_to_supplier_group.py index f0907af333..e9c81bf4ee 100644 --- a/erpnext/patches/v11_0/rename_supplier_type_to_supplier_group.py +++ b/erpnext/patches/v11_0/rename_supplier_type_to_supplier_group.py @@ -25,10 +25,13 @@ def build_tree(): where is_group = 0""".format(_('All Supplier Groups'))) if not frappe.db.exists("Supplier Group", _('All Supplier Groups')): - frappe.get_doc({ + supplier_group = frappe.get_doc({ 'doctype': 'Supplier Group', 'supplier_group_name': _('All Supplier Groups'), - 'is_group': 1 - }).insert(ignore_permissions=True) + 'is_group': 1, + 'parent_supplier_group': '' + }) + supplier_group.flags.ignore_validate=True + supplier_group.insert(ignore_permissions=True) rebuild_tree("Supplier Group", "parent_supplier_group")