Merge pull request #590 from frappe/develop
chore: Merge develop to main
This commit is contained in:
commit
6339e8c260
@ -124,7 +124,8 @@ def get_quotation_url(crm_deal, organization):
|
|||||||
frappe.throw(_("ERPNext is not integrated with the CRM"))
|
frappe.throw(_("ERPNext is not integrated with the CRM"))
|
||||||
|
|
||||||
contact = get_contact(crm_deal)
|
contact = get_contact(crm_deal)
|
||||||
address = get_organization_address(organization).get("name") if organization else None
|
address = get_organization_address(organization)
|
||||||
|
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")
|
quotation_url = get_url_to_list("Quotation")
|
||||||
@ -142,7 +143,11 @@ def create_prospect_in_remote_site(crm_deal, erpnext_crm_settings):
|
|||||||
client = get_erpnext_site_client(erpnext_crm_settings)
|
client = get_erpnext_site_client(erpnext_crm_settings)
|
||||||
doc = frappe.get_cached_doc("CRM Deal", crm_deal)
|
doc = frappe.get_cached_doc("CRM Deal", crm_deal)
|
||||||
contacts = get_contacts(doc)
|
contacts = get_contacts(doc)
|
||||||
address = get_organization_address(doc.organization)
|
address = get_organization_address(doc.organization) or None
|
||||||
|
|
||||||
|
if address and not isinstance(address, dict):
|
||||||
|
address = address.as_dict()
|
||||||
|
|
||||||
return client.post_api(
|
return client.post_api(
|
||||||
"erpnext.crm.frappe_crm_api.create_prospect_against_crm_deal",
|
"erpnext.crm.frappe_crm_api.create_prospect_against_crm_deal",
|
||||||
{
|
{
|
||||||
@ -155,9 +160,9 @@ def create_prospect_in_remote_site(crm_deal, erpnext_crm_settings):
|
|||||||
"industry": doc.industry,
|
"industry": doc.industry,
|
||||||
"website": doc.website,
|
"website": doc.website,
|
||||||
"annual_revenue": doc.annual_revenue,
|
"annual_revenue": doc.annual_revenue,
|
||||||
"contacts": json.dumps(contacts),
|
"contacts": json.dumps(contacts) if contacts else None,
|
||||||
"erpnext_company": erpnext_crm_settings.erpnext_company,
|
"erpnext_company": erpnext_crm_settings.erpnext_company,
|
||||||
"address": address.as_dict() if address else None,
|
"address": json.dumps(address) if address else None,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|||||||
@ -256,7 +256,7 @@ const { $socket } = globalStore()
|
|||||||
|
|
||||||
const callPopupHeader = ref(null)
|
const callPopupHeader = ref(null)
|
||||||
const showCallPopup = ref(false)
|
const showCallPopup = ref(false)
|
||||||
const showSmallCallPopup = ref(false)
|
let showSmallCallPopup = ref(false)
|
||||||
|
|
||||||
function toggleCallPopup() {
|
function toggleCallPopup() {
|
||||||
showCallPopup.value = !showCallPopup.value
|
showCallPopup.value = !showCallPopup.value
|
||||||
|
|||||||
@ -606,6 +606,15 @@ function contactOptions(contact) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function addContact(contact) {
|
async function addContact(contact) {
|
||||||
|
if (dealContacts.data?.find((c) => c.name === contact)) {
|
||||||
|
createToast({
|
||||||
|
title: __('Contact already added'),
|
||||||
|
icon: 'x',
|
||||||
|
iconClasses: 'text-ink-red-3',
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
let d = await call('crm.fcrm.doctype.crm_deal.crm_deal.add_contact', {
|
let d = await call('crm.fcrm.doctype.crm_deal.crm_deal.add_contact', {
|
||||||
deal: props.dealId,
|
deal: props.dealId,
|
||||||
contact,
|
contact,
|
||||||
|
|||||||
@ -534,6 +534,15 @@ function contactOptions(contact) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function addContact(contact) {
|
async function addContact(contact) {
|
||||||
|
if (dealContacts.data?.find((c) => c.name === contact)) {
|
||||||
|
createToast({
|
||||||
|
title: __('Contact already added'),
|
||||||
|
icon: 'x',
|
||||||
|
iconClasses: 'text-ink-red-3',
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
let d = await call('crm.fcrm.doctype.crm_deal.crm_deal.add_contact', {
|
let d = await call('crm.fcrm.doctype.crm_deal.crm_deal.add_contact', {
|
||||||
deal: props.dealId,
|
deal: props.dealId,
|
||||||
contact,
|
contact,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user