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

closes #25948

(cherry picked from commit 1eb2526d0b)

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
This commit is contained in:
Frappe PR Bot
2021-08-27 12:59:00 +05:30
committed by GitHub
parent 64fab5b7d1
commit 0767d2dac2

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