[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

@@ -4,6 +4,10 @@
frappe.provide("erpnext.support");
frappe.ui.form.on("Warranty Claim", {
setup: function(frm) {
frm.set_query('contact_person', erpnext.queries.contact_query);
frm.set_query('customer_address', erpnext.queries.address_query);
},
customer: function(frm) {
erpnext.utils.get_party_details(frm);
},
@@ -17,6 +21,8 @@ frappe.ui.form.on("Warranty Claim", {
erpnext.support.WarrantyClaim = frappe.ui.form.Controller.extend({
refresh: function() {
frappe.contact_link = {doc: this.frm.doc, fieldname: 'customer', doctype: 'Customer'}
if(!cur_frm.doc.__islocal &&
(cur_frm.doc.status=='Open' || cur_frm.doc.status == 'Work In Progress')) {
cur_frm.add_custom_button(__('Maintenance Visit'),
@@ -40,18 +46,6 @@ cur_frm.cscript.onload = function(doc,cdt,cdn){
set_multiple(cdt,cdn,{status:'Open'});
}
cur_frm.fields_dict['customer_address'].get_query = function(doc, cdt, cdn) {
return{
filters:{ 'customer': doc.customer}
}
}
cur_frm.fields_dict['contact_person'].get_query = function(doc, cdt, cdn) {
return{
filters:{ 'customer': doc.customer}
}
}
cur_frm.fields_dict['serial_no'].get_query = function(doc, cdt, cdn) {
var cond = [];
var filter = [