From a19c98255f89d40d6defdf356a72c7e3853a96d8 Mon Sep 17 00:00:00 2001 From: Saqib Date: Mon, 12 Apr 2021 19:02:28 +0530 Subject: [PATCH] fix: patch condition (#25301) --- erpnext/patches/v12_0/add_company_link_to_einvoice_settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/patches/v12_0/add_company_link_to_einvoice_settings.py b/erpnext/patches/v12_0/add_company_link_to_einvoice_settings.py index fe284e814c..3b560fd43a 100644 --- a/erpnext/patches/v12_0/add_company_link_to_einvoice_settings.py +++ b/erpnext/patches/v12_0/add_company_link_to_einvoice_settings.py @@ -12,5 +12,5 @@ def execute(): select dl.link_name from `tabAddress` a, `tabDynamic Link` dl where a.gstin = %s and dl.parent = a.name and dl.link_doctype = 'Company' """, (creds.get('gstin'))) - if company_name[0]: + if company_name and len(company_name) == 1: frappe.db.set_value('E Invoice User', creds.get('name'), 'company', company_name[0][0]) \ No newline at end of file