تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
11731 أدوات العرض

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
أكتوبر 23
6520
2
نوفمبر 22
6915
0
سبتمبر 21
3018
4
أغسطس 20
7832
2
ديسمبر 19
2723