OCA / server-tools

Tools for Odoo Administrators to improve some technical features on Odoo.
https://odoo-community.org/psc-teams/tools-30
GNU Affero General Public License v3.0
705 stars 1.5k forks source link

[16.0][IMP] fetchmail_attach_from_folder: Read e-mails are excluded #3001

Closed zamberjo closed 3 months ago

zamberjo commented 4 months ago

If you have a folder with a large number of emails, fetch_mail is executed for all of them.

We add the flag to read only the unread ones. In this way a lot of load is released on the server.

OCA-git-bot commented 4 months ago

Hi @NL66278, some modules you are maintaining are being modified, check this out!

NL66278 commented 4 months ago

The customer for which we wrote this originally, and it will be the same with others, had a large problem with users reading the mailbox also in their mail client. Then the mails would no longer be fetched by Odoo. So reading all undeleted mails is intentional. However the performance problem is real. Therefore the possibility to put mails handled by fetchmail into another folder, so they will be read only once. Only reading mails that are unread might be another approach to the problem, if it can be guaranteed that the user thus not read the mails in any other way. However this should then be configurable, and for compatibility reasons default off. I suggest adding a boolean field fetch_unseen_only, default False, and add the flag if it has been set.

zamberjo commented 4 months ago

I suggest adding a boolean field fetch_unseen_only, default False, and add the flag if it has been set.

I get on with it

zamberjo commented 4 months ago

Added fetch_unseen_only field.

zamberjo commented 3 months ago

Hi @OCA/tools-maintainers can someone review/merge this?

NL66278 commented 3 months ago

/ocabot rebase

OCA-git-bot commented 3 months ago

@NL66278 The rebase process failed, because command git merge tmp-pr-3001 failed with output:

Auto-merging fetchmail_attach_from_folder/models/fetchmail_server_folder.py
CONFLICT (content): Merge conflict in fetchmail_attach_from_folder/models/fetchmail_server_folder.py
Auto-merging fetchmail_attach_from_folder/views/fetchmail_server.xml
Automatic merge failed; fix conflicts and then commit the result.
zamberjo commented 3 months ago

I just saw that there was a conflict. Rebase done

OCA-git-bot commented 3 months ago

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

NL66278 commented 3 months ago

/ocabot merge minor

OCA-git-bot commented 3 months ago

Hey, thanks for contributing! Proceeding to merge this for you. Prepared branch 16.0-ocabot-merge-pr-3001-by-NL66278-bump-minor, awaiting test results.

OCA-git-bot commented 3 months ago

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