Merge pull request #22038 from frappe/mergify/bp/version-13-beta-pre-release/pr-22037

fix: check if swift_number exists in bank account (bp #22037)
This commit is contained in:
Deepesh Garg 2020-05-29 13:22:21 +05:30 committed by GitHub
commit 295dcd87f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,7 @@ import frappe
def execute():
frappe.reload_doc('accounts', 'doctype', 'bank', force=1)
if frappe.db.table_exists('Bank') and frappe.db.table_exists('Bank Account'):
if frappe.db.table_exists('Bank') and frappe.db.table_exists('Bank Account') and frappe.db.has_column('Bank Account', 'swift_number'):
frappe.db.sql("""
UPDATE `tabBank` b, `tabBank Account` ba
SET b.swift_number = ba.swift_number, b.branch_code = ba.branch_code
@ -12,4 +12,4 @@ def execute():
""")
frappe.reload_doc('accounts', 'doctype', 'bank_account')
frappe.reload_doc('accounts', 'doctype', 'payment_request')
frappe.reload_doc('accounts', 'doctype', 'payment_request')