fix: v13 migration fails due to missing reload_doc (#27192)

closes #25948
This commit is contained in:
Ankush Menat
2021-08-27 11:24:38 +05:30
committed by GitHub
parent 85fe755f89
commit 1eb2526d0b

View File

@@ -3,10 +3,14 @@ import frappe
def execute():
company = frappe.get_all('Company', filters = {'country': 'India'})
if not company or not frappe.db.count('E Invoice User'):
if not company:
return
frappe.reload_doc("regional", "doctype", "e_invoice_user")
if not frappe.db.count('E Invoice User'):
return
for creds in frappe.db.get_all('E Invoice User', fields=['name', 'gstin']):
company_name = frappe.db.sql("""
select dl.link_name from `tabAddress` a, `tabDynamic Link` dl