Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
11568 Widoki

Hi, I'm using odoo v.10 and using project issue for helpdesk.
I'm able to set email and create project issue from incoming email.

what I want to ask is how to take object from email to helpdesk ticket?
I want to create description from email message value,

currently only ticket title is created from email subject.

Awatar
Odrzuć
Autor Najlepsza odpowiedź

Hi, Thank you for the answer, but i'm using project issue module from odoo 10.
so what I do right now is

1. set up incoming mail server

2. set up  "Create a New Record : Project Issue" under " Actions to Perform on Incoming Mails "

This will make every incoming email creating ticket for project issue.
when I send email to create ticket, new ticket created with email subject as the title, but there is no description.
I want to make email content to be ticket description


Awatar
Odrzuć
Najlepsza odpowiedź

HI,

step 1:set incoming email server

step 2: set email alias 

add message_new  function in helpdesk.ticket

use this as example..


@api.model
def message_new(self, msg, custom_values=None):
body = tools.html2plaintext(msg.get('body'))
bre = re.match(r"(.*)^-- *$", body, re.MULTILINE | re.DOTALL | re.UNICODE)
desc = bre.group(1) if bre else None
parent_customer = self.env['res.partner'].browse([msg.get('author_id')]).commercial_partner_id
email_split = tools.email_split(msg.get('email_from'))
values = dict(custom_values or {},
reported_time = msg.get('date'),
reported_by = msg.get('author_id'),
description = desc or body)
create_context = dict(self.env.context or {})
ticket = super(HelpdeskTickets, self.with_context(create_context)).message_new(msg, custom_values=values)
partner_ids = [x for x in ticket._find_partner_from_emails(tools.email_split(msg.get('cc') or '')) if x]
ticket_contacts = [i for i in partner_ids if i in parent_customer.child_ids.ids]
ticket.write({'partner_id': parent_customer.id,
'partner_name':msg.get('email_from').split('<')[0],
'partner_email':email_split[0] if email_split else parent_customer.email,
'contact_ids':[(6,0, ticket_contacts)]})
if partner_ids:
ticket.message_subscribe(partner_ids)
return ticket
Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
paź 23
6408
2
lis 22
6784
0
wrz 21
2886
4
sie 20
7709
2
gru 19
2655