Skip to content

Commit

Permalink
Merge PR #491 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Dec 19, 2023
2 parents 134781a + f6b940f commit 8a189e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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 <[email protected]>",
"from": "Bob <[email protected]>",
"to": "[email protected]",
"cc": "[email protected]",
"recipients": "[email protected][email protected]",
Expand Down

0 comments on commit 8a189e5

Please sign in to comment.