Odoo Help

1
1 Answer
1
Avatar

Ray Carnes

--Ray Carnes--
2409
| 4 2 6
Highland, United States
--Ray Carnes--

Business Analyst - Custom Projects

https://www.linkedin.com/in/raycarnes

Ray Carnes
1/31/19, 7:53 PM

Yes.

Every Internal Note that "mentions" others (see https://www.odoo.com/documentation/user/12.0/discuss/mentions.html) results in an email sent to each one. The email includes a link to get them back to the Document in Odoo from which the Internal Note was sent.  It may be that you want to give them more information to help them decide how quickly they need to get back into Odoo.

If you'd like to include additional context from the Document, you can intercept the creation of the related Outgoing Mail record (mail.mail) and inject additional information.

 

An Internal Note like this:


Could send an Email with much more information, like this:



Example:



# if the email is related to a Project Task and is an Internal Note
if record.model == 'project.task' and record.message_type == 'comment':
# try to find the related Project Task record
  task = env['project.task'].search([('id','=',record.res_id)])

  if task:
    new_body = ""

    if task.partner_id:
      new_body = new_body + "Customer: " + task.partner_id.name + "<br/>"

    if task.project_id:
      new_body = new_body + "Project: " + task.project_id.name + "<br/>"

    if task.date_deadline:
      new_body = new_body + "Deadline: " + task.date_deadline + "<br/>"

new_body = new_body + "<br/>"

    record['body_html'] = record.body_html.replace("</table>","</table></div><div>" + new_body)



Ask a Question
Keep Informed
1 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now