diff --git a/erpnext/accounts/doctype/sales_invoice/regional/italy.js b/erpnext/accounts/doctype/sales_invoice/regional/italy.js index 0c20f364a45..2f305b914eb 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 149b32df123..6ef82971f5c 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 @@ frappe.ui.form.on("Opportunity", { } } }); + + 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 7dbe485d29f..54f0aadb1dd 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 = { 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 430d9968e8e..517d87127a7 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.sales_common = { erpnext.selling.SellingController = class SellingController extends erpnext.TransactionController { setup() { super.setup(); + this.frm.email_field = "contact_email"; } onload() { @@ -61,7 +60,7 @@ erpnext.sales_common = { 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 @@ erpnext.sales_common = { } 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 = "
" + @@ -271,7 +270,7 @@ erpnext.sales_common = { 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 = ''; }