make creation and deletion work
This commit is contained in:
parent
4ae237e10a
commit
7c7f315e52
4 changed files with 28 additions and 5 deletions
|
@ -53,7 +53,7 @@ class OdooAPI:
|
|||
logger.debug("Full error details:", exc_info=True)
|
||||
raise
|
||||
|
||||
def create_lead(self, lead):
|
||||
def create_lead(self, lead, source="form"):
|
||||
"""Create a lead in Odoo"""
|
||||
try:
|
||||
logger.info(
|
||||
|
@ -74,6 +74,11 @@ class OdooAPI:
|
|||
if 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")
|
||||
|
||||
# Prepare lead data
|
||||
lead_data = {
|
||||
"name": f"Servala - Interest in {lead.service.name}",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue