mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 18:21:22 +00:00
fix: Update patch and bank form cleanup
This commit is contained in:
@@ -13,9 +13,11 @@ frappe.ui.form.on('Bank', {
|
|||||||
frm.toggle_display(['address_html','contact_html'], !frm.doc.__islocal);
|
frm.toggle_display(['address_html','contact_html'], !frm.doc.__islocal);
|
||||||
|
|
||||||
if (frm.doc.__islocal) {
|
if (frm.doc.__islocal) {
|
||||||
|
frm.set_df_property('address_and_contact', 'hidden', 1);
|
||||||
frappe.contacts.clear_address_and_contact(frm);
|
frappe.contacts.clear_address_and_contact(frm);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
frm.set_df_property('address_and_contact', 'hidden', 0);
|
||||||
frappe.contacts.render_address_and_contact(frm);
|
frappe.contacts.render_address_and_contact(frm);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,14 +9,14 @@
|
|||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
"field_order": [
|
"field_order": [
|
||||||
"bank_name",
|
|
||||||
"bank_details_section",
|
"bank_details_section",
|
||||||
|
"bank_name",
|
||||||
"swift_number",
|
"swift_number",
|
||||||
"column_break_1",
|
"column_break_1",
|
||||||
"branch_code",
|
"branch_code",
|
||||||
|
"website",
|
||||||
"address_and_contact",
|
"address_and_contact",
|
||||||
"address_html",
|
"address_html",
|
||||||
"website",
|
|
||||||
"column_break_13",
|
"column_break_13",
|
||||||
"contact_html",
|
"contact_html",
|
||||||
"data_import_configuration_section",
|
"data_import_configuration_section",
|
||||||
@@ -44,7 +44,6 @@
|
|||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 1,
|
"in_standard_filter": 1,
|
||||||
"label": "SWIFT number",
|
"label": "SWIFT number",
|
||||||
"reqd": 0,
|
|
||||||
"unique": 1
|
"unique": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -59,7 +58,6 @@
|
|||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 1,
|
"in_standard_filter": 1,
|
||||||
"label": "Branch Code",
|
"label": "Branch Code",
|
||||||
"reqd": 0,
|
|
||||||
"unique": 1
|
"unique": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -112,40 +110,23 @@
|
|||||||
"read_only": 1
|
"read_only": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"has_web_view": 0,
|
"links": [],
|
||||||
"hide_heading": 0,
|
"modified": "2020-03-25 21:22:33.496264",
|
||||||
"hide_toolbar": 0,
|
|
||||||
"idx": 0,
|
|
||||||
"image_view": 0,
|
|
||||||
"in_create": 0,
|
|
||||||
"is_submittable": 0,
|
|
||||||
"issingle": 0,
|
|
||||||
"istable": 0,
|
|
||||||
"max_attachments": 0,
|
|
||||||
"modified": "2018-11-27 16:12:13.938776",
|
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Bank",
|
"name": "Bank",
|
||||||
"name_case": "",
|
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
"amend": 0,
|
|
||||||
"cancel": 0,
|
|
||||||
"create": 1,
|
"create": 1,
|
||||||
"delete": 1,
|
"delete": 1,
|
||||||
"email": 1,
|
"email": 1,
|
||||||
"export": 1,
|
"export": 1,
|
||||||
"if_owner": 0,
|
|
||||||
"import": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"print": 1,
|
"print": 1,
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"report": 1,
|
"report": 1,
|
||||||
"role": "System Manager",
|
"role": "System Manager",
|
||||||
"set_user_permissions": 0,
|
|
||||||
"share": 1,
|
"share": 1,
|
||||||
"submit": 0,
|
|
||||||
"write": 1
|
"write": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -200,7 +200,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2020-01-29 20:42:26.458316",
|
"modified": "2020-01-30 20:42:26.458316",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Bank Account",
|
"name": "Bank Account",
|
||||||
|
|||||||
@@ -4,17 +4,11 @@ import frappe
|
|||||||
def execute():
|
def execute():
|
||||||
frappe.reload_doc('accounts', 'doctype', 'bank', force=1)
|
frappe.reload_doc('accounts', 'doctype', 'bank', force=1)
|
||||||
|
|
||||||
banks = frappe.get_all('Bank', 'name')
|
frappe.db.sql("""
|
||||||
for bank in banks:
|
UPDATE `tabBank` b, `tabBank Account` ba
|
||||||
bank_accounts = frappe.get_all('Bank Account', filters={'bank': bank.name}, fields=['swift_number', 'branch_code'])
|
SET b.swift_number = ba.swift_number, b.branch_code = ba.branch_code
|
||||||
bank_account = ''
|
WHERE b.name = ba.bank
|
||||||
if len(bank_accounts):
|
""")
|
||||||
bank_account = bank_accounts[0]
|
|
||||||
if bank_account and bank_account.swift_number:
|
|
||||||
bank.swift_number = bank_account.swift_number
|
|
||||||
if bank_account and bank_account.branch_code:
|
|
||||||
bank.branch_code = bank_account.branch_code
|
|
||||||
bank.save()
|
|
||||||
|
|
||||||
frappe.reload_doc('accounts', 'doctype', 'bank_account')
|
frappe.reload_doc('accounts', 'doctype', 'bank_account')
|
||||||
frappe.reload_doc('accounts', 'doctype', 'payment_request')
|
frappe.reload_doc('accounts', 'doctype', 'payment_request')
|
||||||
Reference in New Issue
Block a user