콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
10987 화면

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.

아바타
취소
작성자 베스트 답변

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


아바타
취소
베스트 답변

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
아바타
취소
관련 게시물 답글 화면 활동
2
10월 23
5828
2
11월 22
6294
0
9월 21
2475
4
8월 20
7356
2
12월 19
2340