Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][FIX] Email formating when receive it by mail gateway, create new ticket with wrong label #491

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion helpdesk_mgmt/models/helpdesk_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,17 @@ def message_new(self, msg, custom_values=None):
"""
if custom_values is None:
custom_values = {}
partner_name, partner_email = next(
iter(tools.email_split_tuples(msg.get("from"))), ("", "")
)
defaults = {
"name": msg.get("subject") or _("No Subject"),
"description": msg.get("body"),
"partner_email": msg.get("from"),
"partner_email": partner_email,
"partner_id": msg.get("author_id"),
}
if not msg.get("author_id"):
defaults["partner_name"] = partner_name
defaults.update(custom_values)

# Write default values coming from msg
Expand Down
1 change: 1 addition & 0 deletions helpdesk_mgmt/tests/test_helpdesk_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def test_helpdesk_ticket_message_new(self):
"message_id": msg_id,
"subject": title,
"email_from": "Bob <bob@example.com>",
"from": "Bob <bob@example.com>",
"to": "jill@example.com",
"cc": "sally@example.com",
"recipients": "jill@example.com+sally@example.com",
Expand Down
Loading