Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
5357 มุมมอง

Currently if user send mail to project alias odoo adds message body to task or issue as a comment. How to make odoo store message body as a taks or issue description?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Try to update the function message_post of a related model. An example for project.issue:

@api.multi

    @api.returns('mail.message', lambda value: value.id)

    def message_post(self, subtype=None, **kwargs):

 self.ensure_one()

 mail_message = super(ProjectIssue, self).message_post(subtype=subtype, **kwargs)

 if kwargs.get('body'):

  if self.description:

   description = self.description + kwargs.get('body')

  else:

   description = kwargs.get('body')

  self.sudo().write({'description': description)

 return mail_message


This code would add all the messages bodies to description. You may add other conditions to restrict messages, e.g by subtype or when authors are portal

P.S. for newly created issues update the function message_new

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
เม.ย. 18
3145
0
ก.พ. 18
89
2
ส.ค. 22
5166
3
ม.ค. 19
9273
3
มิ.ย. 18
4731