fix: reload SI meta before checking

This commit is contained in:
Dany Robert 2021-12-07 15:21:51 +05:30 committed by GitHub
parent 848b641d7b
commit 811e51fb50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,5 +10,7 @@ def execute():
if not company:
return
if frappe.db.exists('DocType', 'Sales Invoice') and frappe.get_meta('Sales Invoice').has_field('qr_code'):
rename_field('Sales Invoice', 'qr_code', 'ksa_einv_qr')
if frappe.db.exists('DocType', 'Sales Invoice'):
frappe.reload_doc('accounts', 'doctype', 'sales_invoice', force=True)
if frappe.db.has_column('Sales Invoice', 'qr_code'):
rename_field('Sales Invoice', 'qr_code', 'ksa_einv_qr')