[contact/address] fixed auto setting closes #475 (erpnext)

This commit is contained in:
Rushabh Mehta
2013-06-14 13:29:20 +05:30
parent 1475e4d295
commit 37982a6a1f
18 changed files with 91 additions and 211 deletions

View File

@@ -49,19 +49,6 @@ cur_frm.cscript.make_address = function() {
parent: cur_frm.fields_dict['address_html'].wrapper,
page_length: 5,
new_doctype: "Address",
custom_new_doc: function(doctype) {
var address = wn.model.make_new_doc_and_get_name('Address');
address = locals['Address'][address];
address.supplier = cur_frm.doc.name;
address.supplier_name = cur_frm.doc.supplier_name;
address.address_title = cur_frm.doc.supplier_name;
if(!(cur_frm.address_list.data && cur_frm.address_list.data.length)) {
address.address_type = "Office";
}
wn.set_route("Form", "Address", address.name);
},
get_query: function() {
return "select name, address_type, address_line1, address_line2, city, state, country, pincode, fax, email_id, phone, is_primary_address, is_shipping_address from tabAddress where supplier='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_address desc"
},
@@ -80,13 +67,6 @@ cur_frm.cscript.make_contact = function() {
parent: cur_frm.fields_dict['contact_html'].wrapper,
page_length: 5,
new_doctype: "Contact",
custom_new_doc: function(doctype) {
var contact = wn.model.make_new_doc_and_get_name('Contact');
contact = locals['Contact'][contact];
contact.supplier = cur_frm.doc.name;
contact.supplier_name = cur_frm.doc.supplier_name;
wn.set_route("Form", "Contact", contact.name);
},
get_query: function() {
return "select name, first_name, last_name, email_id, phone, mobile_no, department, designation, is_primary_contact from tabContact where supplier='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_contact desc"
},