Vauxoo / odoo

Fork of Odoo (formerly OpenERP). [This project is not publically mantained just born for internal usage with some little patches] go to official repository on github.com/odoo/odoo
https://www.odoo.com
Other
9 stars 9 forks source link

[FIX] mass_mailing: make recipients unique by email #604

Open maneandrea opened 2 weeks ago

maneandrea commented 2 weeks ago

This commit makes the recipients of any mass.mailing res_model unique by email. The email can be read from either the email field or the partner_id.email field, if they exist, otherwise the behavior is as usual.

The partner_id case requires a further loop of deduplication because partner_id.email is not stored in sale.order and read_group does not allow fetching indirect fields.

Related: https://gitlab.com/ircanada/ircodoo/-/issues/2849


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

maneandrea commented 2 weeks ago

@moylop260 Can you review?

The res.partner case required a further loop of deduplication because read_group does not allow indirect fields as group (such as partner_id.email) nor it allows them as aggregators (which would have also helped)

moylop260 commented 2 weeks ago

👍