From fe86debf5de1d106f8605af6c25fbbf44a87a37c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 24 Oct 2016 17:47:02 +0530 Subject: [PATCH] [fix] Duplicate salary components --- erpnext/patches/v7_0/rename_salary_components.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/erpnext/patches/v7_0/rename_salary_components.py b/erpnext/patches/v7_0/rename_salary_components.py index ecf2faf34a..4e9ceb2173 100644 --- a/erpnext/patches/v7_0/rename_salary_components.py +++ b/erpnext/patches/v7_0/rename_salary_components.py @@ -78,9 +78,12 @@ def execute(): for doctype, cols in dt_cols_de.items(): source_cols = "`" + "`, `".join(standard_cols_de + cols) + "`" - - frappe.db.sql("""INSERT INTO `tabSalary Component` ({0}) SELECT {1} FROM `tab{2}`""" - .format(target_cols, source_cols, doctype)) + try: + frappe.db.sql("""INSERT INTO `tabSalary Component` ({0}) SELECT {1} FROM `tab{2}`""" + .format(target_cols, source_cols, doctype)) + except Exception, e: + if e.args[0]==1062: + pass update_customizations()