diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index d3acb75915..ed2a1d4f0f 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -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 }) } diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index 57d14b68f6..8e759f77dd 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -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 }) }, diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js index d43fab072a..37326afa48 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js @@ -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 }) } }); diff --git a/erpnext/hr/doctype/appraisal/appraisal.js b/erpnext/hr/doctype/appraisal/appraisal.js index 3cd7adb0c7..84ab964b93 100644 --- a/erpnext/hr/doctype/appraisal/appraisal.js +++ b/erpnext/hr/doctype/appraisal/appraisal.js @@ -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" } -} \ No newline at end of file + return{ query: "erpnext.controllers.queries.employee_query" } +} diff --git a/erpnext/hr/doctype/employee/employee.js b/erpnext/hr/doctype/employee/employee.js index 581eaccc3a..fabdfb840e 100644 --- a/erpnext/hr/doctype/employee/employee.js +++ b/erpnext/hr/doctype/employee/employee.js @@ -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 }); } }); diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.js b/erpnext/hr/doctype/salary_structure/salary_structure.js index e50a99c7ba..8ee67a5be3 100644 --- a/erpnext/hr/doctype/salary_structure/salary_structure.js +++ b/erpnext/hr/doctype/salary_structure/salary_structure.js @@ -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 }); } diff --git a/erpnext/projects/doctype/time_log_batch/time_log_batch.js b/erpnext/projects/doctype/time_log_batch/time_log_batch.js index c2d353531d..8fea083962 100644 --- a/erpnext/projects/doctype/time_log_batch/time_log_batch.js +++ b/erpnext/projects/doctype/time_log_batch/time_log_batch.js @@ -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 }); } }); diff --git a/erpnext/selling/doctype/lead/lead.js b/erpnext/selling/doctype/lead/lead.js index 83639d4a6a..66b52700af 100644 --- a/erpnext/selling/doctype/lead/lead.js +++ b/erpnext/selling/doctype/lead/lead.js @@ -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 }) } }); diff --git a/erpnext/selling/doctype/opportunity/opportunity.js b/erpnext/selling/doctype/opportunity/opportunity.js index 989e4d96c4..8fd4e82b47 100644 --- a/erpnext/selling/doctype/opportunity/opportunity.js +++ b/erpnext/selling/doctype/opportunity/opportunity.js @@ -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 }); } diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js index b694529bfe..ee140923f5 100644 --- a/erpnext/selling/doctype/quotation/quotation.js +++ b/erpnext/selling/doctype/quotation/quotation.js @@ -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 }) } diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js index 75a2c39287..dce9916c51 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -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 }) }, }); diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js index c2658309e3..c0586b3185 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.js +++ b/erpnext/stock/doctype/delivery_note/delivery_note.js @@ -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 }); }, diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js index 271fe86568..8dabbd30d5 100644 --- a/erpnext/stock/doctype/material_request/material_request.js +++ b/erpnext/stock/doctype/material_request/material_request.js @@ -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 }) } }); diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js index b23b041b33..2dc99ef606 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js @@ -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 }) }, diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js index 245ff74d58..5373436525 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js @@ -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"); } } }); diff --git a/erpnext/support/doctype/customer_issue/customer_issue.js b/erpnext/support/doctype/customer_issue/customer_issue.js index 74ff7d7aee..036f14ea3d 100644 --- a/erpnext/support/doctype/customer_issue/customer_issue.js +++ b/erpnext/support/doctype/customer_issue/customer_issue.js @@ -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 }) } }); diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js index 476530b4dc..17cc29da04 100644 --- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js +++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js @@ -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 }) }); }