Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

How to get first help desk message from the customer in the create method?

Subscriure's

Get notified when there's activity on this post

This question has been flagged
tickethelpdesk
4846 Vistes
Avatar
Neil S

I have a contact form setup on my external non-odoo website that sends emails to my odoo help desk. The 'from' email address is no-reply@mydomain.com and not the customers email so in the help desk the customer name and email are not correct. The customers name and email are in the body of the first email sent to the help desk.  Is it possible to retrieve the first message sent to the helpdesk in the create method in helpdesk_ticket.py?


@api.model_create_multi
def create(self, list_value):
now = fields.Datetime.now()
# determine user_id and stage_id if not given. Done in batch.
teams = self.env['helpdesk.team'].browse([vals['team_id'] for vals in list_value if vals.get('team_id')])
team_default_map = dict.fromkeys(teams.ids, dict())
for team in teams:
team_default_map[team.id] = {
'stage_id': team._determine_stage()[team.id].id,
'user_id': team._determine_user_to_assign()[team.id].id
}

_logger.info("in create");
_logger.info(list_value);
# Manually create a partner now since 'generate_recipients' doesn't keep the name. This is
# to avoid intrusive changes in the 'mail' module
for vals in list_value:
partner_id = vals.get('partner_id', False)
partner_name = vals.get('partner_name', False)
partner_email = vals.get('partner_email', False)
if partner_name and partner_email and not partner_id:
try:
vals['partner_id'] = self.env['res.partner'].find_or_create(
tools.formataddr((partner_name, partner_email))
)
except UnicodeEncodeError:
# 'formataddr' doesn't support non-ascii characters in email. Therefore, we fall
# back on a simple partner creation.
vals['partner_id'] = self.env['res.partner'].create({
'name': partner_name,
'email': partner_email,
}).id

# determine partner email for ticket with partner but no email given
partners = self.env['res.partner'].browse([vals['partner_id'] for vals in list_value if 'partner_id' in vals and vals.get('partner_id') and 'partner_email' not in vals])
partner_email_map = {partner.id: partner.email for partner in partners}
partner_name_map = {partner.id: partner.name for partner in partners}

for vals in list_value:
if vals.get('team_id'):
team_default = team_default_map[vals['team_id']]
if 'stage_id' not in vals:
vals['stage_id'] = team_default['stage_id']
# Note: this will break the randomly distributed user assignment. Indeed, it will be too difficult to
# equally assigned user when creating ticket in batch, as it requires to search after the last assigned
# after every ticket creation, which is not very performant. We decided to not cover this user case.
if 'user_id' not in vals:
vals['user_id'] = team_default['user_id']
if vals.get('user_id'): # if a user is finally assigned, force ticket assign_date and reset assign_hours
vals['assign_date'] = fields.Datetime.now()
vals['assign_hours'] = 0

# set partner email if in map of not given
if vals.get('partner_id') in partner_email_map:
vals['partner_email'] = partner_email_map.get(vals['partner_id'])
# set partner name if in map of not given
if vals.get('partner_id') in partner_name_map:
vals['partner_name'] = partner_name_map.get(vals['partner_id'])

if vals.get('stage_id'):
vals['date_last_stage_update'] = now

# context: no_log, because subtype already handle this
tickets = super(Ticket, self).create(list_value)

# make customer follower
for ticket in tickets:
if ticket.partner_id:
ticket.message_subscribe(partner_ids=ticket.partner_id.ids)

ticket._portal_ensure_token()

# apply SLA
tickets.sudo()._sla_apply()

return tickets


0
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
Reply by email to helpdesk ticket problem Solved
ticket helpdesk
Avatar
Avatar
Avatar
3
de març 25
5993
How to Create a Custom Autogenerating Ticket Number in Odoo Helpdesk (e.g., INC-12345)? Solved
ticket helpdesk FieldService
Avatar
Avatar
1
d’abr. 25
3363
Error when exporting tickets from Odoo 16
export ticket helpdesk
Avatar
0
d’ag. 24
1811
HELPDESK AUTOMATIC EMAIL CREATION
mail ticket helpdesk
Avatar
Avatar
Avatar
2
d’ag. 24
3851
Assignee ticket to employee (not user)
ticket employee helpdesk
Avatar
Avatar
1
de juny 23
3139
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now