[cleanup] move contact, address to frappe 💥

This commit is contained in:
Rushabh Mehta
2017-01-13 18:53:11 +05:30
parent 448acf6f46
commit b92087cb2d
52 changed files with 196 additions and 3168 deletions

View File

@@ -32,6 +32,8 @@ frappe.ui.form.on("Customer", {
erpnext.toggle_naming_series();
}
frappe.contact_link = {doc: frm.doc, fieldname: 'name', doctype: 'Customer'}
frm.toggle_display(['address_html','contact_html'], !frm.doc.__islocal);
if(!frm.doc.__islocal) {

View File

@@ -32,11 +32,7 @@ erpnext.selling.InstallationNote = frappe.ui.form.Controller.extend({
}
});
this.frm.set_query("contact_person", function() {
return {
filters: {'customer': me.frm.doc.customer }
}
});
this.frm.set_query('contact_person', erpnext.queries.contact_query);
this.frm.set_query("customer", function() {
return {

View File

@@ -16,6 +16,7 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
},
refresh: function(doc, dt, dn) {
this._super(doc, dt, dn);
if(doc.docstatus == 1 && doc.status!=='Lost') {
cur_frm.add_custom_button(__('Make Sales Order'),
cur_frm.cscript['Make Sales Order']);

View File

@@ -203,13 +203,6 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
// for backward compatibility: combine new and previous states
$.extend(cur_frm.cscript, new erpnext.selling.SalesOrderController({frm: cur_frm}));
cur_frm.cscript.new_contact = function(){
tn = frappe.model.make_new_doc_and_get_name('Contact');
locals['Contact'][tn].is_customer = 1;
if(doc.customer) locals['Contact'][tn].customer = doc.customer;
frappe.set_route('Form', 'Contact', tn);
}
cur_frm.fields_dict['project'].get_query = function(doc, cdt, cdn) {
return {
query: "erpnext.controllers.queries.get_project_name",