Add address and contact fields to bank
Address and contact fields are enabled for DocType Bank
This commit is contained in:
parent
e4d8ee5ba8
commit
3cb9f4ab73
@ -7,7 +7,18 @@ frappe.ui.form.on('Bank', {
|
|||||||
},
|
},
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
add_fields_to_mapping_table(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);
|
||||||
|
}
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,6 +5,12 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
from frappe.contacts.address_and_contact import load_address_and_contact, delete_contact_and_address
|
||||||
|
|
||||||
class Bank(Document):
|
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)
|
Loading…
Reference in New Issue
Block a user