Merge pull request #1649 from anandpdoshi/hotfix

Pass frm to open_mapped_doc
This commit is contained in:
Anand Doshi 2014-05-14 18:00:30 +05:30
commit f70c7320d5
17 changed files with 31 additions and 29 deletions

View File

@ -270,7 +270,7 @@ cur_frm.cscript.is_opening = function(doc, dt, dn) {
cur_frm.cscript['Make Delivery Note'] = function() {
frappe.model.open_mapped_doc({
method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.make_delivery_note",
source_name: cur_frm.doc.name
frm: cur_frm
})
}

View File

@ -43,14 +43,14 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
make_purchase_receipt: function() {
frappe.model.open_mapped_doc({
method: "erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_receipt",
source_name: cur_frm.doc.name
frm: cur_frm
})
},
make_purchase_invoice: function() {
frappe.model.open_mapped_doc({
method: "erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_invoice",
source_name: cur_frm.doc.name
frm: cur_frm
})
},

View File

@ -39,7 +39,7 @@ erpnext.buying.SupplierQuotationController = erpnext.buying.BuyingController.ext
make_purchase_order: function() {
frappe.model.open_mapped_doc({
method: "erpnext.buying.doctype.supplier_quotation.supplier_quotation.make_purchase_order",
source_name: cur_frm.doc.name
frm: cur_frm
})
}
});

View File

@ -5,7 +5,7 @@ cur_frm.add_fetch('employee', 'company', 'company');
cur_frm.add_fetch('employee', 'employee_name', 'employee_name');
cur_frm.cscript.onload = function(doc,cdt,cdn){
if(!doc.status)
if(!doc.status)
set_multiple(cdt,cdn,{status:'Draft'});
if(doc.amended_from && doc.__islocal) {
doc.status = "Draft";
@ -27,6 +27,7 @@ cur_frm.cscript.kra_template = function(doc, dt, dn) {
frappe.model.map_current_doc({
method: "erpnext.hr.doctype.appraisal.appraisal.fetch_appraisal_template",
source_name: cur_frm.doc.kra_template,
frm: cur_frm
});
}
@ -71,5 +72,5 @@ cur_frm.cscript.calculate_total = function(doc,cdt,cdn){
}
cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) {
return{ query: "erpnext.controllers.queries.employee_query" }
}
return{ query: "erpnext.controllers.queries.employee_query" }
}

View File

@ -58,7 +58,7 @@ erpnext.hr.EmployeeController = frappe.ui.form.Controller.extend({
make_salary_structure: function(btn) {
frappe.model.open_mapped_doc({
method: "erpnext.hr.doctype.employee.employee.make_salary_structure",
source_name: cur_frm.doc.name
frm: cur_frm
});
}
});

View File

@ -21,7 +21,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn){
cur_frm.cscript['Make Salary Slip'] = function() {
frappe.model.open_mapped_doc({
method: "erpnext.hr.doctype.salary_structure.salary_structure.make_salary_slip",
source_name: cur_frm.doc.name
frm: cur_frm
});
}

View File

@ -32,7 +32,7 @@ $.extend(cur_frm.cscript, {
make_invoice: function() {
frappe.model.open_mapped_doc({
method: "erpnext.projects.doctype.time_log_batch.time_log_batch.make_sales_invoice",
source_name: cur_frm.doc.name
frm: cur_frm
});
}
});

View File

@ -78,14 +78,14 @@ erpnext.LeadController = frappe.ui.form.Controller.extend({
create_customer: function() {
frappe.model.open_mapped_doc({
method: "erpnext.selling.doctype.lead.lead.make_customer",
source_name: cur_frm.doc.name
frm: cur_frm
})
},
create_opportunity: function() {
frappe.model.open_mapped_doc({
method: "erpnext.selling.doctype.lead.lead.make_opportunity",
source_name: cur_frm.doc.name
frm: cur_frm
})
}
});

View File

@ -73,7 +73,7 @@ erpnext.selling.Opportunity = frappe.ui.form.Controller.extend({
create_quotation: function() {
frappe.model.open_mapped_doc({
method: "erpnext.selling.doctype.opportunity.opportunity.make_quotation",
source_name: cur_frm.doc.name
frm: cur_frm
})
}
});
@ -110,7 +110,8 @@ cur_frm.cscript.lead = function(doc, cdt, cdn) {
cur_frm.toggle_display("contact_info", doc.customer || doc.lead);
frappe.model.map_current_doc({
method: "erpnext.selling.doctype.lead.lead.make_opportunity",
source_name: cur_frm.doc.lead
source_name: cur_frm.doc.lead,
frm: cur_frm
});
}

View File

@ -134,7 +134,7 @@ cur_frm.fields_dict.lead.get_query = function(doc,cdt,cdn) {
cur_frm.cscript['Make Sales Order'] = function() {
frappe.model.open_mapped_doc({
method: "erpnext.selling.doctype.quotation.quotation.make_sales_order",
source_name: cur_frm.doc.name
frm: cur_frm
})
}

View File

@ -102,35 +102,35 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
make_material_request: function() {
frappe.model.open_mapped_doc({
method: "erpnext.selling.doctype.sales_order.sales_order.make_material_request",
source_name: cur_frm.doc.name
frm: cur_frm
})
},
make_delivery_note: function() {
frappe.model.open_mapped_doc({
method: "erpnext.selling.doctype.sales_order.sales_order.make_delivery_note",
source_name: cur_frm.doc.name
frm: cur_frm
})
},
make_sales_invoice: function() {
frappe.model.open_mapped_doc({
method: "erpnext.selling.doctype.sales_order.sales_order.make_sales_invoice",
source_name: cur_frm.doc.name
frm: cur_frm
})
},
make_maintenance_schedule: function() {
frappe.model.open_mapped_doc({
method: "erpnext.selling.doctype.sales_order.sales_order.make_maintenance_schedule",
source_name: cur_frm.doc.name
frm: cur_frm
})
},
make_maintenance_visit: function() {
frappe.model.open_mapped_doc({
method: "erpnext.selling.doctype.sales_order.sales_order.make_maintenance_visit",
source_name: cur_frm.doc.name
frm: cur_frm
})
},
});

View File

@ -70,14 +70,14 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend(
make_sales_invoice: function() {
frappe.model.open_mapped_doc({
method: "erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice",
source_name: cur_frm.doc.name
frm: cur_frm
})
},
make_installation_note: function() {
frappe.model.open_mapped_doc({
method: "erpnext.stock.doctype.delivery_note.delivery_note.make_installation_note",
source_name: cur_frm.doc.name
frm: cur_frm
});
},

View File

@ -139,21 +139,21 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten
make_purchase_order: function() {
frappe.model.open_mapped_doc({
method: "erpnext.stock.doctype.material_request.material_request.make_purchase_order",
source_name: cur_frm.doc.name
frm: cur_frm
})
},
make_supplier_quotation: function() {
frappe.model.open_mapped_doc({
method: "erpnext.stock.doctype.material_request.material_request.make_supplier_quotation",
source_name: cur_frm.doc.name
frm: cur_frm
})
},
make_stock_entry: function() {
frappe.model.open_mapped_doc({
method: "erpnext.stock.doctype.material_request.material_request.make_stock_entry",
source_name: cur_frm.doc.name
frm: cur_frm
})
}
});

View File

@ -87,7 +87,7 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend
make_purchase_invoice: function() {
frappe.model.open_mapped_doc({
method: "erpnext.stock.doctype.purchase_receipt.purchase_receipt.make_purchase_invoice",
source_name: cur_frm.doc.name
frm: cur_frm
})
},

View File

@ -22,7 +22,6 @@ erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({
callback: function(r) {
if (!r.exc) {
me.frm.set_value("expense_account", r.message);
me.frm.script_manager.trigger("refresh");
}
}
});

View File

@ -20,7 +20,7 @@ erpnext.support.CustomerIssue = frappe.ui.form.Controller.extend({
make_maintenance_visit: function() {
frappe.model.open_mapped_doc({
method: "erpnext.support.doctype.customer_issue.customer_issue.make_maintenance_visit",
source_name: cur_frm.doc.name
frm: cur_frm
})
}
});

View File

@ -33,7 +33,8 @@ erpnext.support.MaintenanceSchedule = frappe.ui.form.Controller.extend({
this.frm.add_custom_button(__("Make Maintenance Visit"), function() {
frappe.model.open_mapped_doc({
method: "erpnext.support.doctype.maintenance_schedule.maintenance_schedule.make_maintenance_visit",
source_name: me.frm.doc.name
source_name: me.frm.doc.name,
frm: me.frm
})
});
}