From dfdb95bbbe2490c08ee6a6f83aa1e97b1820c8d6 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 20 May 2024 18:24:20 +0530 Subject: [PATCH] patch: create custom field for accounting dimensions only if the field not exists already (#41484) fix: create custom field for accounting dimensions only if the field not exists already --- .../v13_0/create_accounting_dimensions_for_asset_repair.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/patches/v13_0/create_accounting_dimensions_for_asset_repair.py b/erpnext/patches/v13_0/create_accounting_dimensions_for_asset_repair.py index 61a5c86386c..a1719fb41bb 100644 --- a/erpnext/patches/v13_0/create_accounting_dimensions_for_asset_repair.py +++ b/erpnext/patches/v13_0/create_accounting_dimensions_for_asset_repair.py @@ -13,8 +13,9 @@ def execute(): for d in accounting_dimensions: doctype = "Asset Repair" field = frappe.db.get_value("Custom Field", {"dt": doctype, "fieldname": d.fieldname}) + docfield = frappe.db.get_value("DocField", {"parent": doctype, "fieldname": d.fieldname}) - if field: + if field or docfield: continue df = {