mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-11 22:38:25 +00:00
fix: ignore non-unique swift numbers while migrating (#30139)
(cherry picked from commit 4d8798b0ea)
Co-authored-by: Saqib Ansari <nextchamp.saqib@gmail.com>
This commit is contained in:
@@ -6,10 +6,13 @@ def execute():
|
||||
frappe.reload_doc('accounts', 'doctype', 'bank', force=1)
|
||||
|
||||
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 WHERE b.name = ba.bank
|
||||
""")
|
||||
try:
|
||||
frappe.db.sql("""
|
||||
UPDATE `tabBank` b, `tabBank Account` ba
|
||||
SET b.swift_number = ba.swift_number WHERE b.name = ba.bank
|
||||
""")
|
||||
except Exception as e:
|
||||
frappe.log_error(e, title="Patch Migration Failed")
|
||||
|
||||
frappe.reload_doc('accounts', 'doctype', 'bank_account')
|
||||
frappe.reload_doc('accounts', 'doctype', 'payment_request')
|
||||
|
||||
Reference in New Issue
Block a user