Friday, February 21, 2025
2 changes · saas-18.2
Enhancements to existing features
Email recipients are now determined more consistently across Odoo, including records that do not store an email address directly. This reduces duplicated logic and helps templates and related workflows suggest the right people more reliably.
Original PR description
SPECIFICATIONS Similar to '_mail_get_partners' being based on '_mail_get_partner_fields', define a helper to fetch primary email of records. It allows inheritance in some cases where directly field…
SPECIFICATIONS Similar to '_mail_get_partners' being based on '_mail_get_partner_fields', define a helper to fetch primary email of records. It allows inheritance in some cases where directly field access is not possible. Use it in default recipients computation so that overrides are taken into account. This is going to be used notably in salary offer model which has linked models (applicant, employee), without or without partner, but no email field per se. Make suggested recipients computation being based on default recipients with some additional being added. This allows to remove some duplicated computation. Make suggested recipients computation available as a base method, to be used notably in templates on non-thread models. Also make it batch-enabled as it is currently running on a singleton recordset. This requires some rewriting and code move in order to benefit from batch searches and prefetchs. Update tests and addon code accordingly. Todo in master: rework those methods to have a cleaner API and single return type. LINKS Direct followup of odoo/odoo#198173: cleanup default recipients computation Followup of odoo/odoo#172714: improve default behavior of templates Followup of odoo/odoo#188642 : main branch for email-like recipients Task-4555506: Cleanup / Mergeup default / suggested recipients
Email recipients are now determined more consistently from linked records such as applicants and employees, even when a direct contact partner is missing. This reduces failed or incomplete salary offer emails and removes duplicated recipient logic across mail-related flows.
Original PR description
SPECIFICATIONS Similar to '_mail_get_partners' being based on '_mail_get_partner_fields', define a helper to fetch primary email of records. It allows inheritance in some cases where directly field…
SPECIFICATIONS Similar to '_mail_get_partners' being based on '_mail_get_partner_fields', define a helper to fetch primary email of records. It allows inheritance in some cases where directly field access is not possible. Use it in default recipients computation so that overrides are taken into account. This is going to be used notably in salary offer model which has linked models (applicant, employee), without or without partner, but no email field per se. Make suggested recipients computation being based on default recipients with some additional being added. This allows to remove some duplicated computation. Make suggested recipients computation available as a base method, to be used notably in templates on non-thread models. Also make it batch-enabled as it is currently running on a singleton recordset. This requires some rewriting and code move in order to benefit from batch searches and prefetchs. Update tests and addon code accordingly. Todo in master: rework those methods to have a cleaner API and single return type. LINKS Direct followup of odoo/odoo#198173: cleanup default recipients computation Followup of odoo/odoo#172714: improve default behavior of templates Followup of odoo/odoo#188642 : main branch for email-like recipients Task-4555506: Cleanup / Mergeup default / suggested recipients