Skip to content
Snippets Groups Projects
Commit 5397cb7c authored by konykon's avatar konykon
Browse files

Merge branch 'edit-crm-lead-name' into 'dev'

Edit crm lead name

See merge request !235
parents eea1d1e9 5703f53a
No related branches found
No related tags found
3 merge requests!239Draft: [REL] energy_communities: dependency energy_selfconsumption bump to,!235Edit crm lead name,!227[REL] Release 16/10/23
Pipeline #61166 passed
......@@ -2156,6 +2156,30 @@ msgstr ""
msgid "ZIP code not found"
msgstr "Codi postal no trobat"
#. module: energy_communities
#: code:addons/energy_communities/services/crm_lead_service.py:0
#, python-format
msgid "[Contact CE]"
msgstr "[Contacte CE]"
#. module: energy_communities
#: code:addons/energy_communities/services/crm_lead_service.py:0
#, python-format
msgid "[Contact SomComunitats]"
msgstr "[Contacte SomComunitats]"
#. module: energy_communities
#: code:addons/energy_communities/services/crm_lead_service.py:0
#, python-format
msgid "[Newsletter CE]"
msgstr "[Butlletí CE]"
#. module: energy_communities
#: code:addons/energy_communities/services/crm_lead_service.py:0
#, python-format
msgid "[Newsletter SomComunitats]"
msgstr "[Butlletí SomComunitats]"
#. module: energy_communities
#: model:mail.template,subject:energy_communities.email_template_confirmation_company
msgid "[Somcomunitats.coop] Application to become Community membership"
......@@ -2203,6 +2227,12 @@ msgstr ""
"[Somcomunitats.coop] Sol·licitud d’Alta de Comunitat Energètica a la "
"plataforma"
#. module: energy_communities
#: code:addons/energy_communities/services/crm_lead_service.py:0
#, python-format
msgid "[Subscription CE]"
msgstr "[Alta CE]"
#. module: energy_communities
#: model_terms:ir.ui.view,arch_db:energy_communities.voluntary_share_text_template
msgid "and"
......
......@@ -1971,6 +1971,30 @@ msgstr ""
msgid "ZIP code not found"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/services/crm_lead_service.py:0
#, python-format
msgid "[Contact CE]"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/services/crm_lead_service.py:0
#, python-format
msgid "[Contact SomComunitats]"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/services/crm_lead_service.py:0
#, python-format
msgid "[Newsletter CE]"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/services/crm_lead_service.py:0
#, python-format
msgid "[Newsletter SomComunitats]"
msgstr ""
#. module: energy_communities
#: model:mail.template,subject:energy_communities.email_template_confirmation_company
msgid "[Somcomunitats.coop] Application to become Community membership"
......@@ -2013,6 +2037,12 @@ msgid ""
" platform"
msgstr ""
#. module: energy_communities
#: code:addons/energy_communities/services/crm_lead_service.py:0
#, python-format
msgid "[Subscription CE]"
msgstr ""
#. module: energy_communities
#: model_terms:ir.ui.view,arch_db:energy_communities.voluntary_share_text_template
msgid "and"
......
......@@ -1990,6 +1990,30 @@ msgstr "Debe seleccionarse un Diario específico para Socias en esta compañía.
msgid "ZIP code not found"
msgstr "Código postal no encontrado"
#. module: energy_communities
#: code:addons/energy_communities/services/crm_lead_service.py:0
#, python-format
msgid "[Contact CE]"
msgstr "[Contacto CE]"
#. module: energy_communities
#: code:addons/energy_communities/services/crm_lead_service.py:0
#, python-format
msgid "[Contact SomComunitats]"
msgstr "[Contacto SomComunitats]"
#. module: energy_communities
#: code:addons/energy_communities/services/crm_lead_service.py:0
#, python-format
msgid "[Newsletter CE]"
msgstr "[Boletín CE]"
#. module: energy_communities
#: code:addons/energy_communities/services/crm_lead_service.py:0
#, python-format
msgid "[Newsletter SomComunitats]"
msgstr "[Boletín SomComunitats]"
#. module: energy_communities
#: model:mail.template,subject:energy_communities.email_template_confirmation_company
msgid "[Somcomunitats.coop] Application to become Community membership"
......@@ -2036,6 +2060,12 @@ msgstr ""
"[Somcomunitats.coop] Solicitud de alta de Comunidad Energética en la "
"plataforma"
#. module: energy_communities
#: code:addons/energy_communities/services/crm_lead_service.py:0
#, python-format
msgid "[Subscription CE]"
msgstr "[Alta CE]"
#. module: energy_communities
#: model_terms:ir.ui.view,arch_db:energy_communities.voluntary_share_text_template
msgid "and"
......
......@@ -2157,6 +2157,30 @@ msgstr "Kolaboratzaileen aldizkari bat ezarri behar duzu zure enpresan."
msgid "ZIP code not found"
msgstr "Ez da posta kodea aurkitu"
#. module: energy_communities
#: code:addons/energy_communities/services/crm_lead_service.py:0
#, python-format
msgid "[Contact CE]"
msgstr "[Kontaktua CE]"
#. module: energy_communities
#: code:addons/energy_communities/services/crm_lead_service.py:0
#, python-format
msgid "[Contact SomComunitats]"
msgstr "[Kontaktua SomComunitats]"
#. module: energy_communities
#: code:addons/energy_communities/services/crm_lead_service.py:0
#, python-format
msgid "[Newsletter CE]"
msgstr "[Buletinerako CE]"
#. module: energy_communities
#: code:addons/energy_communities/services/crm_lead_service.py:0
#, python-format
msgid "[Newsletter SomComunitats]"
msgstr "[Buletinerako SomComunitats]"
#. module: energy_communities
#: model:mail.template,subject:energy_communities.email_template_confirmation_company
msgid "[Somcomunitats.coop] Application to become Community membership"
......@@ -2194,6 +2218,12 @@ msgstr ""
msgid "[Somcomunitats.coop] Platform Newsletter Subscription Request"
msgstr "[Somcomunitats.coop] Plataformako buletinen harpidetza"
#. module: energy_communities
#: code:addons/energy_communities/services/crm_lead_service.py:0
#, python-format
msgid "[Subscription CE]"
msgstr "[Harpidetza CE]"
#. module: energy_communities
#: model_terms:ir.ui.view,arch_db:energy_communities.voluntary_share_text_template
msgid "and"
......
......@@ -28,6 +28,7 @@ class CRMLeadService(Component):
if target_source_xml_id:
# setup utm source on crm lead
crm_lead_id = crm_lead.get("id", False)
self._set_name(crm_lead_id, params)
self._setup_lead_utm_source(crm_lead_id, target_source_xml_id)
# select autoresponder notification id based on utm source
......@@ -68,6 +69,39 @@ class CRMLeadService(Component):
lang = data["value"]
return lang
def _get_ce_name(self, params):
metadata = params["metadata"]
for data in metadata:
if data["key"] == "ce_name":
ce_name = data["value"]
return ce_name
def _set_name(self, lead_id, params):
source_xml_id = self._get_source_xml_id(params)
lead = self.env["crm.lead"].browse(lead_id)
email = params["email_from"]
prefix = None
if source_xml_id == "ce_source_existing_ce_contact":
prefix = _("[Contact CE]")
elif source_xml_id == "ce_source_existing_ce_info":
prefix = _("[Newsletter CE]")
elif source_xml_id == "ce_source_general_contact":
prefix = _("[Contact SomComunitats]")
elif source_xml_id == "ce_source_general_info":
prefix = _("[Newsletter SomComunitats]")
if source_xml_id == "ce_source_creation_ce_proposal":
prefix = _("[Subscription CE]")
ce_name = self._get_ce_name(params)
name = "{prefix} {lead_id} {ce_name}".format(
prefix=prefix, lead_id=lead_id, ce_name=ce_name
)
else:
name = "{prefix} {lead_id} {email}".format(
prefix=prefix, lead_id=lead_id, email=email
)
if lead:
lead.write({"name": name})
def _get_autoresponder_email_template(self, source_xml_id):
template_external_id = None
if source_xml_id == "ce_source_creation_ce_proposal":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment