-
-
Notifications
You must be signed in to change notification settings - Fork 588
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
12.0 mig mass_mailing_custom_unsubscribe #402
12.0 mig mass_mailing_custom_unsubscribe #402
Conversation
…ption (OCA#58) * [8.0][IMP][mass_mailing_custom_unsubscribe] Get reasons for unsubscription.
- Imported last updates from v8. - Adapted to v9. - Added a saner default to `mass_mailing.salt` configuration parameter by reusing `database.secret` if available, hoping that some day odoo/odoo#12040 gets merged. - Updated README. - Increase security, drop backwards compatibility. Security got improved upstream, which would again break compatibility among current addon and future master upstream. I choose to break it now and keep it secured future-wise, so I drop the backwards compatibility features. - Includes tour tests. - Removes outdated tests. - Extends the mailing list management form when unsubscriber is a contact. - Adds a reason form even if he is not. - Avoids all methods that were not model-agnostic. [FIX][mass_mailing_custom_unsubscribe] Reasons noupdate After this fix, when you update the addon, you will not lose your customized reasons. [FIX] Compatibilize with mass_mailing_partner Current test code was based on the assumption that the `@api.model` decorator on `create()` ensured an empty recordset when running the method, but that's not true. This was causing an incompatibility betwee these tests and the `mass_mailing_partner` addon, which works assuming 0-1 recordsets. Now records are created from an empty recordset, and thus tests work everywhere. Update instructions If the user does not add the unsubscribe snippet, nothing will happen, so it's added to README to avoid confusion when testing/using the addon. [FIX] Use the right operator to preserve recordsets order Using `|=` sorts records at will each time (treating them as Python's `set`). Using `+=` always appends a record to the end of the set. Since we are using the record position in the set, this caused the test to work sometimes and fail other times. Now it works always.
* [IMP] mass_mailing_custom_unsubscribe: GDPR compliance - Record resubscriptions too. - Record action metadata. - Make ESLint happy. - Quick color-based action distinction in tree view. - Add useful quick groupings. - Display (un)subscription metadata. - Pivot & graph views.
This creates inconsistency issues when assembling them in the README.
Currently translated at 80.0% (44 of 55 strings) Translation: social-11.0/social-11.0-mass_mailing_custom_unsubscribe Translate-URL: https://translation.odoo-community.org/projects/social-11-0/social-11-0-mass_mailing_custom_unsubscribe/fr/
Fix assertIn error thrown in testing mode
Updated by Update PO files to match POT (msgmerge) hook in Weblate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like have the main changes on the history.rst file because this much more than a migration and will help reviewers
else: | ||
# Unsubscribe, saving reason and details by context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think you could keep a comment not sure by the content if is still valid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I added the comment again
fe4bc6b
to
07687d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work here, @ernestotejeda
I've been testing the functionality and I'm finding major changes from v11. This is how it worked in v11:
But this is how it works now in v12 (wich is less usable I think):
If only the main screen when the unsubscribe screen was the subscription lists update screen, it would fit the previous behavior.
Thanks for your comment, @chienandalu . I understand your point, but since this is the new unsubscription philosophy now in v12 and I don't think it's less usable, I don't know if it's better to go back to the previous version. Look at the following and tell me what you think ..
and that's not related to the way you subscribe or unsubscribe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few stylistic suggestions, some questions and a few requirements to do.
In general terms, the next time you cannot get a tour to pass, just publish the PR with the failing tour, so we reviewers can help you make it pass again. Publishing the PR removing the tour feels like "tricking" somehow. So, please, restore the tours so we can see the failure and fix it. 😉
Thanks!
mass_mailing_custom_unsubscribe/templates/mass_mailing_contact_reason.xml
Outdated
Show resolved
Hide resolved
mass_mailing_custom_unsubscribe/templates/mass_mailing_contact_reason.xml
Outdated
Show resolved
Hide resolved
07687d3
to
853041a
Compare
@yajo I have made all the changes except some to which I have responded with a comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of details to finish.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the module has no tours now? Why there are removed features? If the scope of the module has changed as well, README should reflect these changes.
@yajo please support @ernestotejeda for a perfect migration, or tell me directly in a meeting the design decisions
mass_mailing_custom_unsubscribe/models/mail_mass_mailing_list.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I forgot the tours thing.
You have to restore them. Please don't remove tours just because they fail; on migrations it's a common thing, and it's not expected that we hide that behind the carpet.
If you cannot make them pass, just push the code and we'll help you 😉
Ok, @ernestotejeda Adapt tours to the new behavior and document it if necessary |
@Tardo, I think @ernestotejeda just copy-pasted upstream's file and tried to stay as close as possible to upstream source code. In this case, upstream code isn't inheritable and we have to replace it completely (@ged-odoo could you help with that? 😇), so it's one of the cases where it's more maintainable to disable the linter than to obey it (so, when we migrate, we copy the new source code from odoo v13 and just apply our little diff). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM but I would like someone to show me funcional use
791dec8
to
5b6733a
Compare
I have made two important changes:
|
@victormmtorres , Here you have a GIF with a use case so you can see how it works. The execution is a bit fast, but I hope it helps you: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Tardo I took the freedom to mark all of your JS comments as resolved, as I saw your 👍 on #402 (comment). Maybe you want to update your review?
5b6733a
to
853ac5b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This module has been lots of issues in the past so please @chienandalu @yajo review in deep.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, now you have some linters to fix and you're done.
- JS lints: https://travis-ci.org/OCA/social/jobs/561045770#L432-L644 (see also comment below)
- Python lints: https://travis-ci.org/OCA/social/jobs/561045770#L322-L323
853ac5b
to
fd6344b
Compare
Changes done |
/ocabot merge |
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at e502eb1. Thanks a lot for contributing to OCA. ❤️ PS: Don't worry if GitHub says there are unmerged commits: it is due to a rebase before merge. All commits of this PR have been merged into |
From Odoo 11 to Odoo 12 have changed several things regarding the subscription/unsubscription of a mass mailing contact, so I had to make several adaptations to the module. Some adaptations are described here:
For the reason explained above for this version of the module I have eliminated what had been done in v11 of the module to force users to choose only one mailing list per contact.
not_cross_unsubscriptable
field from the mailing lists because already in v12 there is a field calledis_public
for the same purpose.The unit tests using the phantom_js are not included here because I have not been able to make them work, so I hope that someone can help me with this.
Cc @Tecnativa