fix: create quotation
(cherry picked from commit 940e8d24c7e1ded869555cbc326a6927eb68455f)
This commit is contained in:
parent
4500595a75
commit
277cebfe7b
@ -128,14 +128,35 @@ def get_quotation_url(crm_deal, organization):
|
|||||||
address = address.get("name") if address else None
|
address = address.get("name") if address else None
|
||||||
|
|
||||||
if not erpnext_crm_settings.is_erpnext_in_different_site:
|
if not erpnext_crm_settings.is_erpnext_in_different_site:
|
||||||
quotation_url = get_url_to_list("Quotation")
|
base_url = f"{get_url_to_list('Quotation')}/new"
|
||||||
return f"{quotation_url}/new?quotation_to=CRM Deal&crm_deal={crm_deal}&party_name={crm_deal}&company={erpnext_crm_settings.erpnext_company}&contact_person={contact}&customer_address={address}"
|
params = {
|
||||||
|
"quotation_to": "CRM Deal",
|
||||||
|
"crm_deal": crm_deal,
|
||||||
|
"party_name": crm_deal,
|
||||||
|
"company": erpnext_crm_settings.erpnext_company,
|
||||||
|
"contact_person": contact,
|
||||||
|
"customer_address": address
|
||||||
|
}
|
||||||
else:
|
else:
|
||||||
site_url = erpnext_crm_settings.get("erpnext_site_url")
|
site_url = erpnext_crm_settings.get("erpnext_site_url")
|
||||||
quotation_url = f"{site_url}/app/quotation"
|
base_url = f"{site_url}/app/quotation/new"
|
||||||
|
|
||||||
prospect = create_prospect_in_remote_site(crm_deal, erpnext_crm_settings)
|
prospect = create_prospect_in_remote_site(crm_deal, erpnext_crm_settings)
|
||||||
return f"{quotation_url}/new?quotation_to=Prospect&crm_deal={crm_deal}&party_name={prospect}&company={erpnext_crm_settings.erpnext_company}&contact_person={contact}&customer_address={address}"
|
params = {
|
||||||
|
"quotation_to": "Prospect",
|
||||||
|
"crm_deal": crm_deal,
|
||||||
|
"party_name": prospect,
|
||||||
|
"company": erpnext_crm_settings.erpnext_company,
|
||||||
|
"contact_person": contact,
|
||||||
|
"customer_address": address
|
||||||
|
}
|
||||||
|
|
||||||
|
# Filter out None values and build query string
|
||||||
|
query_string = "&".join(
|
||||||
|
f"{key}={value}" for key, value in params.items()
|
||||||
|
if value is not None
|
||||||
|
)
|
||||||
|
|
||||||
|
return f"{base_url}?{query_string}"
|
||||||
|
|
||||||
|
|
||||||
def create_prospect_in_remote_site(crm_deal, erpnext_crm_settings):
|
def create_prospect_in_remote_site(crm_deal, erpnext_crm_settings):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user