Skip to content

Commit

Permalink
fix: backward compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
shariquerik committed Sep 24, 2024
1 parent 446c367 commit 96c65ff
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1,714 deletions.
10 changes: 3 additions & 7 deletions crm/fcrm/doctype/erpnext_crm_settings/erpnext_crm_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from frappe.custom.doctype.property_setter.property_setter import make_property_setter
from frappe.model.document import Document
from frappe.frappeclient import FrappeClient
from frappe.utils import get_url_to_form
from frappe.utils import get_url_to_form, get_url_to_list
import json

class ERPNextCRMSettings(Document):
Expand Down Expand Up @@ -93,12 +93,8 @@ def get_customer_link(crm_deal):
frappe.throw(_("ERPNext is not integrated with the CRM"))

if not erpnext_crm_settings.is_erpnext_in_different_site:
customer_url = get_url_to_form("Customer")
customer = frappe.db.exists("Customer", {"crm_deal": crm_deal})
if customer:
return f"{customer_url}/{customer}"
else:
return ""
return get_url_to_form("Customer", customer) if customer else ""
else:
client = get_erpnext_site_client(erpnext_crm_settings)
try:
Expand All @@ -123,7 +119,7 @@ def get_quotation_url(crm_deal, organization):
frappe.throw(_("ERPNext is not integrated with the CRM"))

if not erpnext_crm_settings.is_erpnext_in_different_site:
quotation_url = get_url_to_form("Quotation")
quotation_url = get_url_to_list("Quotation")
return f"{quotation_url}/new?quotation_to=CRM Deal&crm_deal={crm_deal}&party_name={crm_deal}&company={erpnext_crm_settings.erpnext_company}"
else:
site_url = erpnext_crm_settings.get("erpnext_site_url")
Expand Down
Loading

0 comments on commit 96c65ff

Please sign in to comment.