Skip to content

Commit d333d2e

Browse files
fix: Change enquiry_from to opportunity_from in multiple files
1 parent 3b78a01 commit d333d2e

9 files changed

Lines changed: 10 additions & 11 deletions

File tree

erpnext/crm/doctype/opportunity/opportunity.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ frappe.ui.form.on("Opportunity", {
3737

3838
refresh: function(frm) {
3939
var doc = frm.doc;
40-
// frm.events.enquiry_from(frm);
40+
frm.events.opportunity_from(frm);
4141
frm.trigger('toggle_mandatory');
42-
frm.trigger("set_dynamic_field_label");
4342
erpnext.toggle_naming_series();
4443

4544
if(!doc.__islocal && doc.status!=="Lost") {

erpnext/crm/doctype/opportunity/opportunity.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def validate(self):
4444

4545
def make_new_lead_if_required(self):
4646
"""Set lead against new opportunity"""
47-
if not self.customer_lead and self.contact_email: #nosec
47+
if (not self.get("customer_lead")) and self.contact_email:
4848
# check if customer is already created agains the self.contact_email
4949
customer = frappe.db.sql("""select
5050
distinct `tabDynamic Link`.link_name as customer
@@ -242,7 +242,7 @@ def set_missing_values(source, target):
242242
"Opportunity": {
243243
"doctype": "Quotation",
244244
"field_map": {
245-
"enquiry_from": "quotation_to",
245+
"opportunity_from": "quotation_to",
246246
"opportunity_type": "order_type",
247247
"name": "enq_no",
248248
}

erpnext/crm/doctype/opportunity/opportunity_list.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
frappe.listview_settings['Opportunity'] = {
2-
add_fields: ["customer_name", "opportunity_type", "enquiry_from", "status"],
2+
add_fields: ["customer_name", "opportunity_type", "opportunity_from", "status"],
33
get_indicator: function(doc) {
44
var indicator = [__(doc.status), frappe.utils.guess_colour(doc.status), "status,=," + doc.status];
55
if(doc.status=="Quotation") {

erpnext/crm/doctype/opportunity/test_opportunity.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ QUnit.test("test: opportunity", function (assert) {
66
() => frappe.timeout(1),
77
() => frappe.click_button('New'),
88
() => frappe.timeout(1),
9-
() => cur_frm.set_value('enquiry_from', 'Customer'),
9+
() => cur_frm.set_value('opportunity_from', 'Customer'),
1010
() => cur_frm.set_value('customer', 'Test Customer 1'),
1111

1212
// check items

erpnext/crm/report/lead_conversion_time/lead_conversion_time.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def get_columns():
6666
def get_communication_details(filters):
6767
communication_count = None
6868
communication_list = []
69-
opportunities = frappe.db.get_values('Opportunity', {'enquiry_from': 'Lead'},\
69+
opportunities = frappe.db.get_values('Opportunity', {'opportunity_from': 'Lead'},\
7070
['name', 'customer_name', 'lead', 'contact_email'], as_dict=1)
7171

7272
for d in opportunities:

erpnext/demo/user/sales.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def work(domain="Manufacturing"):
5656
def make_opportunity(domain):
5757
b = frappe.get_doc({
5858
"doctype": "Opportunity",
59-
"enquiry_from": "Customer",
59+
"opportunity_from": "Customer",
6060
"customer": get_random("Customer"),
6161
"opportunity_type": "Sales",
6262
"with_items": 1,

erpnext/hub_node/legacy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def make_opportunity(buyer_name, email_id):
2828
lead.save(ignore_permissions=True)
2929

3030
o = frappe.new_doc("Opportunity")
31-
o.enquiry_from = "Lead"
31+
o.opportunity_from = "Lead"
3232
o.lead = frappe.get_all("Lead", filters={"email_id": email_id}, fields = ["name"])[0]["name"]
3333
o.save(ignore_permissions=True)
3434

erpnext/setup/setup_wizard/operations/sample_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def make_sample_data(domains, make_dependent = False):
3333
def make_opportunity(items, customer):
3434
b = frappe.get_doc({
3535
"doctype": "Opportunity",
36-
"enquiry_from": "Customer",
36+
"opportunity_from": "Customer",
3737
"customer": customer,
3838
"opportunity_type": _("Sales"),
3939
"with_items": 1

erpnext/templates/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def send_message(subject="Website Query", message="", sender="", status="Open"):
2828

2929
opportunity = frappe.get_doc(dict(
3030
doctype ='Opportunity',
31-
enquiry_from = 'Customer' if customer else 'Lead',
31+
opportunity_from = 'Customer' if customer else 'Lead',
3232
status = 'Open',
3333
title = subject,
3434
contact_email = sender,

0 commit comments

Comments
 (0)