diff --git a/hub/services/forms.py b/hub/services/forms.py
index 1001f64..25b8187 100644
--- a/hub/services/forms.py
+++ b/hub/services/forms.py
@@ -5,12 +5,13 @@ from .models import Lead, Plan, PlanPrice
class LeadForm(forms.ModelForm):
class Meta:
model = Lead
- fields = ["name", "company", "email", "phone"]
+ fields = ["name", "company", "email", "phone", "message"]
widgets = {
"name": forms.TextInput(attrs={"class": "form-control"}),
"company": forms.TextInput(attrs={"class": "form-control"}),
"email": forms.EmailInput(attrs={"class": "form-control"}),
"phone": forms.TextInput(attrs={"class": "form-control"}),
+ "message": forms.Textarea(attrs={"class": "form-control", "rows": 4}),
}
diff --git a/hub/services/migrations/0004_lead_message.py b/hub/services/migrations/0004_lead_message.py
new file mode 100644
index 0000000..f48d97e
--- /dev/null
+++ b/hub/services/migrations/0004_lead_message.py
@@ -0,0 +1,18 @@
+# Generated by Django 5.1.5 on 2025-01-31 16:07
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("services", "0003_serviceoffering_status"),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="lead",
+ name="message",
+ field=models.TextField(blank=True, max_length=1000),
+ ),
+ ]
diff --git a/hub/services/models.py b/hub/services/models.py
index 09064b9..23bb904 100644
--- a/hub/services/models.py
+++ b/hub/services/models.py
@@ -273,6 +273,7 @@ class Lead(models.Model):
company = models.CharField(max_length=200)
email = models.EmailField()
phone = models.CharField(max_length=50)
+ message = models.TextField(blank=True, max_length=1000)
created_at = models.DateTimeField(auto_now_add=True)
odoo_lead_id = models.IntegerField(null=True, blank=True)
diff --git a/hub/services/odoo.py b/hub/services/odoo.py
index 9e282f3..256bea6 100644
--- a/hub/services/odoo.py
+++ b/hub/services/odoo.py
@@ -86,7 +86,11 @@ class OdooAPI:
"partner_name": lead.company,
"email_from": lead.email,
"phone": lead.phone,
- "description": "
".join(service_details),
+ "description": (
+ f"{lead.message}
" + "
".join(service_details)
+ if lead.message
+ else "
".join(service_details)
+ ),
"type": "lead",
"campaign_id": settings.ODOO_CONFIG["campaign_id"],
"source_id": settings.ODOO_CONFIG["source_id"],
diff --git a/hub/services/templates/services/lead_form.html b/hub/services/templates/services/lead_form.html
index 43eeb37..d5fa2f7 100644
--- a/hub/services/templates/services/lead_form.html
+++ b/hub/services/templates/services/lead_form.html
@@ -5,8 +5,9 @@