Followup of 11067ea9cf
There are 2 cases that breaks the validation:
- If you write list_ids through dot notation, the ORM converts always to command
[(6, 0, <full_list_of_ids>)], so the validation fails, as it checks lists that
have not been modified. Now the diff is done for not having false positives.
- The constraint is being triggered even if there's no real change on the affected
fields. We move the check to the existing create/method code for checking there
real changes.
TT25002
- Create a contact with tag "X"
- Create a dynamic mailing list fully sync with criteria for tag "X".
- Sync it.
- Create a second mailing list non dynamic.
- Try to add the contact to second mailing list.
You get an error in this case, and it shouldn't happen.
- We change the method to hook on (it wasn't correctly overriden anyway)
to ensure the list is resynced even if no recipients are left. For
example: we create a dynamic list with a domain expecting it to sync in
the first mass_mailing. It wouldn't sync as Odoo dismisses the mailing
considering no recipients are left thus it wouldn't get into the
`send_mail` method.
- Adds is_synced field to track whether a dynamic list has unsynced
changes or not so the user is aware that the definitive number of
contacts is yet to be determined.
- It fixes an issue that made impossible deleting a res.partner filter
when a list had use it to filter contacts.
- It also shows only the filters available for the user (shared and
belonging to self).
* [FIX+IMP] mass_mailing_list_dynamic: tests, icons, filters...
* Brand new icon
* Added feature of loading an existing filter as criteria
* Tests as SavepointCase for optimizing times
* Tests in post-install for avoiding errors on res.partner not null constraints
when several modules added them.
* Updated documentation.
* Fix mock in test for not commiting test data.
* [FIX] mass_mailing_list_dynamic: Wasn't able to create contacts in fully synced lists
Syncing context was being set in the wrong object. Added to test too.
* [FIX] mass_mailing_list_dynamic: Allow to write back vals from res.partner
Module mass_mailing_partner writes back certain values from partner to
mass_mailing_contact. Module should allow that write operation.