diff --git a/.env.example b/.env.example
index aa287ce..ab361d7 100644
--- a/.env.example
+++ b/.env.example
@@ -66,3 +66,5 @@ SERVALA_ODOO_DB=''
SERVALA_ODOO_URL=''
SERVALA_ODOO_USERNAME=''
SERVALA_ODOO_PASSWORD=''
+# Helpdesk team ID for support tickets in Odoo. Defaults to 5.
+SERVALA_ODOO_HELPDESK_TEAM_ID='5'
diff --git a/src/servala/core/models/organization.py b/src/servala/core/models/organization.py
index 1662dfa..a9dcd4e 100644
--- a/src/servala/core/models/organization.py
+++ b/src/servala/core/models/organization.py
@@ -58,6 +58,7 @@ class Organization(ServalaModelMixin, models.Model):
details = "{base}details/"
services = "{base}services/"
instances = "{base}instances/"
+ support = "{base}support/"
@cached_property
def slug(self):
diff --git a/src/servala/core/models/user.py b/src/servala/core/models/user.py
index 5d513f4..38cf80c 100644
--- a/src/servala/core/models/user.py
+++ b/src/servala/core/models/user.py
@@ -93,3 +93,24 @@ class User(ServalaModelMixin, PermissionsMixin, AbstractBaseUser):
)
if result:
return result[0]
+
+ def get_or_create_odoo_contact(self, organization):
+ if (
+ not organization.billing_entity
+ or not organization.billing_entity.odoo_company_id
+ ):
+ return None
+
+ if existing_contact := self.get_odoo_contact(organization):
+ return existing_contact["id"]
+
+ partner_data = {
+ "name": f"{self.first_name} {self.last_name}".strip() or self.email,
+ "email": self.email,
+ "company_type": "person",
+ "type": "contact",
+ "parent_id": organization.billing_entity.odoo_company_id,
+ }
+
+ contact_id = odoo.CLIENT.execute("res.partner", "create", [partner_data])
+ return contact_id
diff --git a/src/servala/frontend/forms/__init__.py b/src/servala/frontend/forms/__init__.py
index 01447a1..0bf5d64 100644
--- a/src/servala/frontend/forms/__init__.py
+++ b/src/servala/frontend/forms/__init__.py
@@ -1,4 +1,5 @@
from .organization import OrganizationForm
from .profile import UserProfileForm
+from .support import SupportForm
-__all__ = ["OrganizationForm", "UserProfileForm"]
+__all__ = ["OrganizationForm", "UserProfileForm", "SupportForm"]
diff --git a/src/servala/frontend/forms/support.py b/src/servala/frontend/forms/support.py
new file mode 100644
index 0000000..dd62c95
--- /dev/null
+++ b/src/servala/frontend/forms/support.py
@@ -0,0 +1,10 @@
+from django import forms
+from django.utils.translation import gettext_lazy as _
+
+
+class SupportForm(forms.Form):
+ message = forms.CharField(
+ label=_("Message"),
+ widget=forms.Textarea(attrs={"rows": 8}),
+ help_text=_("Please describe your issue or question in detail."),
+ )
diff --git a/src/servala/frontend/templates/frontend/organizations/support.html b/src/servala/frontend/templates/frontend/organizations/support.html
new file mode 100644
index 0000000..75618a6
--- /dev/null
+++ b/src/servala/frontend/templates/frontend/organizations/support.html
@@ -0,0 +1,43 @@
+{% extends "frontend/base.html" %}
+{% load i18n %}
+{% block html_title %}
+ {% block page_title %}
+ {% translate "Support" %}
+ {% endblock page_title %}
+{% endblock html_title %}
+{% block content %}
+
+ {% translate "Need help? Submit your question or issue below and our support team will get back to you." %}
+
+ {% translate "When you submit a support request, it will be sent to our support team who will respond via email." %}
+ {% translate "For urgent issues, please contact us directly." %}{% translate "Get Support" %}
+ {% translate "Support Information" %}
+