Add address and contact fields to bank

Address and contact fields are enabled for DocType Bank
This commit is contained in:
P-Froggy 2020-02-18 02:14:03 +01:00
parent e4d8ee5ba8
commit 3cb9f4ab73
2 changed files with 19 additions and 2 deletions

View File

@ -7,7 +7,18 @@ frappe.ui.form.on('Bank', {
},
refresh: function(frm) {
add_fields_to_mapping_table(frm);
}
frappe.dynamic_link = { doc: frm.doc, fieldname: 'name', doctype: 'Bank' }
frm.toggle_display(['address_html','contact_html'], !frm.doc.__islocal);
if (frm.doc.__islocal) {
frappe.contacts.clear_address_and_contact(frm);
}
else {
frappe.contacts.render_address_and_contact(frm);
}
},
});

View File

@ -5,6 +5,12 @@
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.contacts.address_and_contact import load_address_and_contact, delete_contact_and_address
class Bank(Document):
pass
def onload(self):
"""Load address and contacts in `__onload`"""
load_address_and_contact(self)
def on_trash(self):
delete_contact_and_address('Bank', self.name)