Commit Graph

60 Commits (17.0)

Author SHA1 Message Date
Pierre Verkest bcfc8fcd09 [FIX] mail_tracking: remove deprecation warning
Since python12 utcfromtimestamp is deprecated which generate deprecation warnings
class TestMailTrackingEmailCleanUp(SavepointCaseWithUserDemo):

fix #1445
2025-01-21 12:08:48 +01:00
trisdoan 82e66467ea [FW] port missing commits from 14.0 to 17.0 2024-10-03 11:41:51 +07:00
Henry Backman 01d268512c mail_tracking: add garbage collection
Add autovacuum to mail_tracking_email that removes old records based on new configuration variable mail_tracking_email_max_age_days.
Due to possibly a large number of records to be deleted on first run, set a default limit of 5000 per run.
2024-10-03 11:40:14 +07:00
Cyril VINH-TUNG ac625ad136 [IMP] Add option to keep aliases in mail tracking 2024-10-03 11:40:14 +07:00
David e981f3cc6d [MIG] mail_tracking: Migration to 17.0
TT49060
2024-06-11 10:08:14 +02:00
Pedro M. Baeza 549006c5dc [IMP] mail_tracking: pre-commit auto fixes 2024-06-11 09:54:49 +02:00
payen000 f25a4a31e6 [MIG] mail_tracking: Completed migration to 16.0
The following changes were implemented:

1 - Added Failed Message component and related components to reuse the
    Message component when rendering failed messages. This allows us to
    dispose of the messagefailed JS model altogether, since failed messages
    are now just regular messages that were marked as failed.

2 - Added Owl reactivity to failed message actions so that browser does
    not have to be reloaded each time a message is marked as reviewed or
    resent.

3 - Fixed 'Retry' and 'Set as reviewed' flows for failed messages.

4 - Fixed `Failed sent messages` filter on models by overriding `get_view`
    instead of `_fields_view_get`

5 - Refactored folder structure to more closely resemble the `mail`
    module's folder structure.

6 - Refactored module to utilize `Command` as a means to create, write,
    etc. instead of `[0, ...]`, `[4, ...]`.

7 - Fixed and added unit tests.

8 - Removed dead/unused code from `v15`.
2024-06-11 09:51:53 +02:00
filoquin e0fee46fa9 [MIG] mail_tracking: Migration to 16.0 2024-06-11 09:51:53 +02:00
David 0de49f2acd [FIX] mail_tracking: failed messages in thread
- Recover the failed messages box in the mail.thread
- Fix failed message box template issues
- Remove dead code
- Fix send_email() method signature
- Fix patch methods js files paths
- Update roadmap

TT44683
2024-06-11 09:51:53 +02:00
dhx 2fe46dd8e1 [IMP] mail_tracking: New config parameter to disable the tracking image
- As the tracker img in the body is currently also used to set the
  X-Odoo-MailTracking-ID mail header we can remove the tag only
  after this is done
- Added tests to check for the presence and absence of the tracking
  image tag depending on the new configuration parameter
2024-06-11 09:51:53 +02:00
David aea5fa7548 [FIX] mail_tracking: allowed trackings compute
In the forward port of the permission check, a column was dropped from
the tuple, but the following code wasn't adapted to the new tuple
length. For clarity sake we also name the tuple unpacking into proper
variables.

TT43453
2024-06-11 09:51:53 +02:00
David e0a4c5b1fe [FIX] mail_tracking: thread permissions
If a user tries to read a thread on a record and one message is from a
partner on which he has no permissions, there will be an exception as
this method tries to fetch info from such partner.

TT43075
2024-06-11 09:51:53 +02:00
Thierry Ducrest 4d6d8cbb17 Fix mail tracking bounce notification not logged
This is to resolve the following issue:

* https://github.com/OCA/social/issues/1121
2024-06-11 09:51:53 +02:00
sergio-teruel 89e10b9310 [FIX] mail_tracking: Crash to add malformed emails to recipients suggestions 2024-06-11 09:51:53 +02:00
jb 4912eb5389 use keyword arguments in build_email to comply with portal tests 2024-06-11 09:51:53 +02:00
david 4cc3d4dc32 [FIX] mail_tracking: permissions
Refine which mail tracking record is allowed to see. We can rely on the
ACLs of the related records so we minimize inconvenient message subject
leaks.

A regular user can read these mail.tracking.email records:

- Those with a linked mail.message that the user can read
- Those with a linked mail.mail that the user can read
- Those with no message/mail link but a linked partner that the user can
read.
- Those with no linked records.

TT31399
2024-06-11 09:51:53 +02:00
Jairo Llopis 2e2158594c [FIX] mail_tracking: process sent events
Up until now, the `sent` event type was never processed, probably because it "made no sense", as an unsent email would never trigger an event.

However, it makes sense to process it because you may have a local relay that transmits mails over to the mail provider. In those circumstances, you should have 2 "sent" events (one from the relay and another one from the provider).

Also marked some useless parts of code for removal.

@Tecnativa TT32365
2024-06-11 09:51:53 +02:00
David 84535f3629 [IMP] mail_tracking_mailgun: mass mailing manual tracking
Mass mailing are tracked from mail.trace as the don't store a message in
the db. In order to gather the message_id and be able to do manual
checks to mailgun, that's the table where we should get the message id.

TT40816
2024-06-11 09:51:53 +02:00
Jasmin Solanki 5e9998e324 [MIG] mail_tracking: Migration to 15.0 2024-06-11 09:51:53 +02:00
Jasmin Solanki 5c383b4724 [IMP] mail_tracking: black, isort, prettier 2024-06-11 09:51:53 +02:00
houssine baa05ca8ab [PORT] porting js code to comply with OWL 2024-06-11 09:51:53 +02:00
Jairo Llopis 266d8cff75 [FIX] mail_tracking: reduce spammy score
Fix https://github.com/OCA/social/issues/701, following idea from https://kb.mailwizz.com/articles/low-score-in-spamassassin-because-of-the-rand_mktg_header-rule/ to avoid matching the regexp explained in https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7888#c5

@Tecnativa TT29674
2024-06-11 09:51:53 +02:00
simonev b62aadeea8 [14.0][MIG] mail_tracking 2024-06-11 09:51:53 +02:00
Areeb Siddiqi 560d49cc42 [IMP] mail_tracking: black, isort, prettier 2024-06-11 09:51:53 +02:00
Alexandre D. Díaz dd9bced5ef [FIX] mail_tracking: Store cc 2024-06-11 09:51:53 +02:00
Alexandre D. Díaz 1cedb804a4 [IMP] mail_tracking: Discuss failed messages: Button and domain + Only show confirmation if needed 2024-06-11 09:51:44 +02:00
nmadhoc 41824cf401 [FIX] mail_tracking
When a user try to resend message gets an error stating that it's only allowed for users who belong to the Administration/Settings group
2024-06-11 09:51:44 +02:00
Wolfgang Pichler d90620f135 [FIX] re.search will return None when nothing found. So we have to check for this 2024-06-11 09:42:20 +02:00
Alexandre Díaz 29edda30bc [IMP] mail_tracking: Ignore catchall 2024-06-11 09:42:20 +02:00
Alexandre Díaz aa8e1e6481 [IMP] mail_tracking: Store To recipients and omit aliases 2024-06-11 09:42:19 +02:00
Alexandre Díaz b52322594c [FIX] mail_tracking: Changed injection method for 'failed_message_ids' field
Before this commit, some methods with views crashes trying to
process 'failed_message_ids' field.
After this commit the 'failed_message_ids' field description
is properly generated.
2024-06-11 09:42:19 +02:00
Alexandre Díaz c3d54d0784 [MIG] mail_tracking: Migration to 13.0 2024-06-11 09:42:19 +02:00
Alexandre Díaz 3b77c528f9 [IMP] mail_tracking: black, isort 2024-06-11 09:42:19 +02:00
Alexandre Díaz f7c8acf6bb [FIX] mail_tracking: Refresh thread widget when sets a message as reviewed
Previous this commit, failed messages widget data wasn't updated properly when you
set as reviewed/retry the last message displayed.

This commit resolve the problem and improves the "set as reviewed" action to avoid
multi-user inconsistencies (don't toggle the value).
2024-06-11 09:42:19 +02:00
Alexandre Díaz b5ee63dec6 [IMP] mail_tracking: Failed Messages to 12.0 2024-06-11 09:42:19 +02:00
Alexandre Díaz b9e43d6d8e [IMP] mail_tracking: translations 2024-06-11 09:42:19 +02:00
Alexandre Díaz 17c39f63ae [IMP] mail_tracking: Convert 'partner_trackings' to dict 2024-06-11 09:42:19 +02:00
Alexandre Díaz 56130736da [IMP] mail_tracking: Cc name & check if mail is Cc 2024-06-11 09:42:19 +02:00
David 2d0c3b7633 [IMP] mail_tracking: mail.thread filter for tracking errors
- Any model inheriting from mail.thread will have a filter available to
obtain records with errors in their messages trackings.
- The messages can be marked as done to avoid false positives when the
issues are solved.
2024-06-11 09:42:19 +02:00
Alexandre Díaz 1756ce1498 [FIX] mail_tracking: Repeated suggested cc emails 2024-06-11 09:42:19 +02:00
Alexandre Díaz 26e8063fd2 [MIG] mail_tracking: Adapt Cc to 12.0 2024-06-11 09:42:19 +02:00
Alexandre Díaz ca30aa43bb [IMP] mail_tracking: Cc 2024-05-30 13:53:46 +02:00
Pedro M. Baeza 8447b7ff33 [FIX] mail_tracking: Don't call write inside other write
Or infinite recursions will happen on other `write` overwrites, like the one that happens
on `mass_mailing_partner`.
2024-05-30 13:53:46 +02:00
ernesto 8ab506bed7 [MIG] mail_tracking: Migration to 12.0 2024-05-30 13:53:46 +02:00
David Vidal 64dd01b7e9 [IMP] mail_tracking: email score performance (#299) 2024-05-30 13:53:46 +02:00
David 0fd3693074 [MIG] mail_tracking: Migration to 11.0 2024-05-30 13:53:46 +02:00
eLBati 3dd37c628d IMP mail_tracking performances
On our server,
queries based on "mail_tracking_event"."tracking_email_id" improved from 501,924 ms to 1,840 ms
queries based on "mail_tracking_email"."mail_message_id" improved from 167,436 ms to 3,223 ms

The last ones are run several times when a thread has many messages
2024-05-30 13:53:46 +02:00
Antonio Espinosa 434d4b7439 [FIX] mail_tracking: bugfixes (#199)
* [FIX] Only one data-odoo-tracking-email tag in each email
* [FIX] Get status even in multicompany instances
2024-05-30 13:53:46 +02:00
Pedro M. Baeza cd3302f7da [FIX] mail_tracking: Obtain outgoing server with sudo
As regular users can't access this object.
2024-05-30 13:53:46 +02:00
Antonio Espinosa b3fc8bd769 [9.0][FIX][mail_tracking] Control exception when mail_message was removed (#132) 2024-05-30 13:53:46 +02:00