diff --git a/hub/services/forms.py b/hub/services/forms.py
index 59af925..a608d44 100644
--- a/hub/services/forms.py
+++ b/hub/services/forms.py
@@ -13,13 +13,3 @@ class LeadForm(forms.ModelForm):
"phone": forms.TextInput(attrs={"class": "form-control"}),
"message": forms.Textarea(attrs={"class": "form-control", "rows": 4}),
}
-
-
-class PlanForm(forms.ModelForm):
- class Meta:
- model = Plan
- fields = ("name", "description")
- widgets = {
- "description": forms.Textarea(attrs={"rows": 3}),
- "features": forms.Textarea(attrs={"rows": 4}),
- }
diff --git a/hub/services/odoo.py b/hub/services/odoo.py
index b25557f..52b6529 100644
--- a/hub/services/odoo.py
+++ b/hub/services/odoo.py
@@ -53,56 +53,21 @@ class OdooAPI:
logger.debug("Full error details:", exc_info=True)
raise
- def create_lead(self, lead, source="form"):
+ def create_lead(self, lead, lead_title=""):
"""Create a lead in Odoo"""
try:
logger.info(f"Attempting to create lead for {lead.name}")
- # Prepare service description
- service_details = []
-
- if hasattr(lead, "service") and lead.service:
- service_details.append(f"Service: {lead.service.name}")
-
- # Get provider name from offering if it exists
- if (
- hasattr(lead, "offering")
- and lead.offering
- and hasattr(lead.offering, "cloud_provider")
- ):
- provider_name = lead.offering.cloud_provider.name
- service_details.append(f"Provider: {provider_name}")
-
- if hasattr(lead, "plan") and lead.plan:
- service_details.append(f"Plan: {lead.plan.name}")
-
- if source == "form":
- service_details.append(f"Source: Servala Website")
- elif source == "osbapi":
- service_details.append(f"Source: OSB API")
- elif source == "contact_form":
- service_details.append(f"Source: Contact Form")
-
- # Prepare lead name based on whether it's a service lead or generic contact
- if hasattr(lead, "service") and lead.service:
- lead_name = f"Servala - Interest in {lead.service.name}"
- else:
- lead_name = "Servala - Website Contact"
-
# Prepare lead data
lead_data = {
- "name": lead_name,
+ "name": "Servala" + lead_title,
"contact_name": lead.name,
"partner_name": (
lead.company if hasattr(lead, "company") and lead.company else ""
),
"email_from": lead.email,
"phone": lead.phone if hasattr(lead, "phone") and lead.phone else "",
- "description": (
- f"{lead.message}
" + "
".join(service_details)
- if lead.message
- else "
".join(service_details)
- ),
+ "description": lead.message,
"type": "lead",
"campaign_id": settings.ODOO_CONFIG["campaign_id"],
"source_id": settings.ODOO_CONFIG["source_id"],
@@ -122,60 +87,6 @@ class OdooAPI:
odoo_lead_id = Lead.create(lead_data)
logger.info(f"Successfully created lead in Odoo with ID: {odoo_lead_id}")
- # Post message in chatter
- if hasattr(lead, "service") and lead.service:
- # For service-related leads
- message_data = {
- "body": f"""
-
Thank you for your interest in the service {lead.service.name}. - We recorded the following information and will get back to you soon:
Contact Details:
-Service Details:
-
Thank you for contacting Servala by VSHN.
- We recorded the following information and will get back to you soon:
Contact Details:
-We'd love to hear from you!
+Your message has been sent successfully.
-We'll get back to you as soon as possible.
- Back to Home -No plans available yet.
- I'm interested in a plan +You miss a consulting partner on this list? Let us know which one and we'll get in touch with you!
+Do you miss a service on this cloud provider? Do you have any questions about this cloud provider? We're here to help!
+You miss a cloud provider on this list? Let us know which one and we'll get in touch with you!
+Choose one of our trusted service providers
+ {% if service.offerings.exists %} +Choose one of our trusted service providers
{% for offering in service.offerings.all %} -{{ offering.cloud_provider.name }}
+{{ offering.cloud_provider.name }}
{% endfor %} {% else %} - I'm interested in this service +Your favorite service is missing? Let us know which one!
-You miss a service on this list? Let us know which one and we'll get in touch with you!
+Thank you for your interest in {{ service.name }}. We have received your inquiry and our team will contact you shortly. A confirmation email will be sent to your provided email address.
-Your message has been sent successfully.
+We'll get back to you as soon as possible.
+ Take me home