Skip to content

Commit

Permalink
T1786 Include direct claims in interaction_resume
Browse files Browse the repository at this point in the history
- Claims made from the website don't post any message in the thread, but put the request directly in the claim's description. Include those in the interaction resume.
  • Loading branch information
ecino committed Sep 3, 2024
1 parent d013957 commit f21e779
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions interaction_resume/models/crm_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@ class CrmRequest(models.Model):
def _get_interaction_data(self, partner_id):
res = []
for claim in self:
if claim.description:
res.append(
{
"partner_id": partner_id,
"res_model": self._name,
"res_id": claim.id,
"direction": "in",
"date": claim.create_date,
"email": claim.email_from or claim.partner_id.email,
"communication_type": "Support",
"subject": claim.name,
"body": html2plaintext(claim.description).replace("\n\n", "\n"),
"has_attachment": bool(claim.message_attachment_count),
"tracking_status": "delivered",
}
)
messages = claim.message_ids.filtered(
lambda m: m.message_type in ("email", "comment")
and (m.author_id.id == partner_id or partner_id in m.partner_ids.ids)
Expand Down
2 changes: 1 addition & 1 deletion interaction_resume/models/other_interaction.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from odoo import models, fields
from odoo import fields, models
from odoo.tools import html2plaintext


Expand Down

0 comments on commit f21e779

Please sign in to comment.