Merge pull request #590 from frappe/develop

chore: Merge develop to main
This commit is contained in:
Shariq Ansari 2025-02-17 13:07:31 +05:30 committed by GitHub
commit 6339e8c260
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 28 additions and 5 deletions

View File

@ -124,7 +124,8 @@ def get_quotation_url(crm_deal, organization):
frappe.throw(_("ERPNext is not integrated with the CRM"))
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:
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)
doc = frappe.get_cached_doc("CRM Deal", crm_deal)
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(
"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,
"website": doc.website,
"annual_revenue": doc.annual_revenue,
"contacts": json.dumps(contacts),
"contacts": json.dumps(contacts) if contacts else None,
"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:

View File

@ -256,7 +256,7 @@ const { $socket } = globalStore()
const callPopupHeader = ref(null)
const showCallPopup = ref(false)
const showSmallCallPopup = ref(false)
let showSmallCallPopup = ref(false)
function toggleCallPopup() {
showCallPopup.value = !showCallPopup.value

View File

@ -606,6 +606,15 @@ function contactOptions(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', {
deal: props.dealId,
contact,

View File

@ -534,6 +534,15 @@ function contactOptions(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', {
deal: props.dealId,
contact,