From 095d99dbd254adf677d1aac6c73c19e496d0f84f Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:09:00 +0530 Subject: [PATCH] fix: patch - Duplicate entry quality inspection parameter (backport #38262) (#38265) fix: patch - Duplicate entry quality inspection parameter (#38262) (cherry picked from commit 0ca7527f7abddcab59edce434d0e68e1deebfc33) Co-authored-by: rohitwaghchaure --- erpnext/patches/v13_0/convert_qi_parameter_to_link_field.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/patches/v13_0/convert_qi_parameter_to_link_field.py b/erpnext/patches/v13_0/convert_qi_parameter_to_link_field.py index e53bdf8f19e3..08ddbbf3375b 100644 --- a/erpnext/patches/v13_0/convert_qi_parameter_to_link_field.py +++ b/erpnext/patches/v13_0/convert_qi_parameter_to_link_field.py @@ -21,6 +21,9 @@ def execute(): params = set({x.casefold(): x for x in params}.values()) for parameter in params: + if frappe.db.exists("Quality Inspection Parameter", parameter): + continue + frappe.get_doc( {"doctype": "Quality Inspection Parameter", "parameter": parameter, "description": parameter} ).insert(ignore_permissions=True)