chore: Remove cur_frm from sales_invoice.js
diff --git a/erpnext/accounts/doctype/sales_invoice/regional/italy.js b/erpnext/accounts/doctype/sales_invoice/regional/italy.js
index 0c20f36..2f305b9 100644
--- a/erpnext/accounts/doctype/sales_invoice/regional/italy.js
+++ b/erpnext/accounts/doctype/sales_invoice/regional/italy.js
@@ -1,7 +1,7 @@
 frappe.ui.form.on("Sales Invoice", {
     refresh: (frm) => {
         if(frm.doc.docstatus == 1) {
-            frm.add_custom_button('Generate E-Invoice', () => {
+            frm.add_custom_button(__('Generate E-Invoice'), () => {
                 frm.call({
                     method: "erpnext.regional.italy.utils.generate_single_invoice",
                     args: {
diff --git a/erpnext/crm/doctype/opportunity/opportunity.js b/erpnext/crm/doctype/opportunity/opportunity.js
index 149b32d..6ef8297 100644
--- a/erpnext/crm/doctype/opportunity/opportunity.js
+++ b/erpnext/crm/doctype/opportunity/opportunity.js
@@ -1,9 +1,6 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 frappe.provide("erpnext.crm");
-
-cur_frm.email_field = "contact_email";
-
 erpnext.pre_sales.set_as_lost("Quotation");
 erpnext.sales_common.setup_selling_controller();
 
@@ -22,6 +19,8 @@
 				}
 			}
 		});
+
+		frm.email_field = "contact_email";
 	},
 
 	validate: function(frm) {
diff --git a/erpnext/public/js/controllers/buying.js b/erpnext/public/js/controllers/buying.js
index 7dbe485..54f0aad 100644
--- a/erpnext/public/js/controllers/buying.js
+++ b/erpnext/public/js/controllers/buying.js
@@ -2,8 +2,6 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.provide("erpnext.buying");
-
-// cur_frm.email_field = "contact_email";
 // cur_frm.add_fetch('project', 'cost_center', 'cost_center');
 
 erpnext.buying = {
@@ -11,6 +9,7 @@
 		erpnext.buying.BuyingController = class BuyingController extends erpnext.TransactionController {
 			setup() {
 				super.setup();
+				this.frm.email_field = "contact_email";
 			}
 
 			onload(doc, cdt, cdn) {
diff --git a/erpnext/public/js/utils/sales_common.js b/erpnext/public/js/utils/sales_common.js
index 430d996..517d871 100644
--- a/erpnext/public/js/utils/sales_common.js
+++ b/erpnext/public/js/utils/sales_common.js
@@ -1,8 +1,6 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-// cur_frm.email_field = "contact_email";
-
 frappe.provide("erpnext.selling");
 
 erpnext.sales_common = {
@@ -10,6 +8,7 @@
 		erpnext.selling.SellingController = class SellingController extends erpnext.TransactionController {
 			setup() {
 				super.setup();
+				this.frm.email_field = "contact_email";
 			}
 
 			onload() {
@@ -61,7 +60,7 @@
 					this.frm.set_query("item_code", "items", function() {
 						return {
 							query: "erpnext.controllers.queries.item_query",
-							filters: {'is_sales_item': 1, 'customer': cur_frm.doc.customer, 'has_variants': 0}
+							filters: {'is_sales_item': 1, 'customer': me.frm.doc.customer, 'has_variants': 0}
 						}
 					});
 				}
@@ -260,9 +259,9 @@
 			}
 
 			set_product_bundle_help(doc) {
-				if(!cur_frm.fields_dict.packing_list) return;
+				if(!this.frm.fields_dict.packing_list) return;
 				if ((doc.packed_items || []).length) {
-					$(cur_frm.fields_dict.packing_list.row.wrapper).toggle(true);
+					$(this.frm.fields_dict.packing_list.row.wrapper).toggle(true);
 
 					if (in_list(['Delivery Note', 'Sales Invoice'], doc.doctype)) {
 						var help_msg = "<div class='alert alert-warning'>" +
@@ -271,7 +270,7 @@
 						frappe.meta.get_docfield(doc.doctype, 'product_bundle_help', doc.name).options = help_msg;
 					}
 				} else {
-					$(cur_frm.fields_dict.packing_list.row.wrapper).toggle(false);
+					$(this.frm.fields_dict.packing_list.row.wrapper).toggle(false);
 					if (in_list(['Delivery Note', 'Sales Invoice'], doc.doctype)) {
 						frappe.meta.get_docfield(doc.doctype, 'product_bundle_help', doc.name).options = '';
 					}