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

Conversation

mathben
Copy link

@mathben mathben commented Jul 23, 2023

[FIX] helpdesk_mgmt: format email when receive it from new message mail gateway

Before, email was like '"Name" [email protected]'
Now, email is like '[email protected]'
To field partner_email into model helpdesk.ticket

@mathben
Copy link
Author

mathben commented Jul 23, 2023

This fix #435

@mathben mathben force-pushed the 14.0_fix_new_message_email_from branch 2 times, most recently from 6911bdf to efecb5f Compare July 23, 2023 05:48
@mathben
Copy link
Author

mathben commented Jul 23, 2023

What do you think about the coverage, do I need to do more test? It's the method _extract_email I created.

@mathben mathben changed the title Fix email formating when receive it by mail gateway, create new ticket with wrong label [14.0][FIX] Email formating when receive it by mail gateway, create new ticket with wrong label Jul 23, 2023
@pedrobaeza pedrobaeza added this to the 14.0 milestone Jul 23, 2023
@pedrobaeza
Copy link
Member

Please check how it's done in project module and mimic it.

@mathben
Copy link
Author

mathben commented Jul 23, 2023

Please check how it's done in project module and mimic it.

This is the code into module project v14.0
https://github.com/odoo/odoo/blob/14.0/addons/project/models/project.py#L1312
I think it has the same problem, I will test it.
tools.email_split() this seems the way instead of using regex.

@mathben mathben force-pushed the 14.0_fix_new_message_email_from branch 2 times, most recently from fc5d8cd to 69cb878 Compare July 24, 2023 03:04
@mathben
Copy link
Author

mathben commented Jul 24, 2023

Please check how it's done in project module and mimic it.

It works now, I tested it.
helpdesk_mgmt it's a different case of project. It's support when partner_id not exist with partner_email and partner_name. So we can fill partner_name from name of email. I can use method tools.email_split_tuples() instead of tools.email_split()

Thanks for your reviews.

@mathben
Copy link
Author

mathben commented Jul 24, 2023

Codecov not pass, because of

        if not msg.get("author_id"):
            defaults["partner_name"] = partner_name

Do you want me to add a duplicate test without author?
I think I can duplicate test method test_helpdesk_ticket_message_new without "partner_ids": [newPartner.id],

Thanks

Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Dec 17, 2023
…ssage

from mail gateway

Fill partner_name if partner_id not found
@mathben mathben force-pushed the 14.0_fix_new_message_email_from branch from 69cb878 to f6b940f Compare December 19, 2023 16:17
@mathben
Copy link
Author

mathben commented Dec 19, 2023

I rebase with 14.0, ready to merge!

@pedrobaeza
Copy link
Member

/ocabot merge patch

Please fw-port it to upper versions.

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 14.0-ocabot-merge-pr-491-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 8a189e5 into OCA:14.0 Dec 19, 2023
5 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at fc5e817. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged 🎉 stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants