Daily updates from Odoo
Monday, November 21, 2022
1 change
Code cleanup and technical improvements
This change standardizes how rendering options are passed when generating email and document content in follow-up, appraisal, and survey-related workflows. It is an internal cleanup that should make future mail rendering changes safer and more consistent, with little direct impact on day-to-day users.
Original PR description
Note: various: account_followup, helpdesk, hr_appraisal(_survey) Due to recent improvements (Jinja -> Qweb, safe rendering) rendering API supports several ways of giving options to the rendering…
Note: various: account_followup, helpdesk, hr_appraisal(_survey) Due to recent improvements (Jinja -> Qweb, safe rendering) rendering API supports several ways of giving options to the rendering process. Those have mainly two usage * ``preserve_comments`` : keep comments in rendered HTML, used notably in mass mailing or digest to keep browser-specific comments; * ``post_process`` : perform a post processing on rendered HTML, used notably to process local links and add tracking to shortened links; All those are now given directly inside an optional ``options`` parameter given to ``_render_field`` and its sub-method ``_render_template``. They can also be defined at field level, using ``render_options`` field parameter. Impacts are * when rendering a MailTemplate field using ``_render_field``: options now come from the template fields definition (see ``body_html`` and ``subject`` generally); * when rendering content using ``render_template``, use ``options`` dict to propagate options; Add engine used for rendering, even if it is the default value, better explicit than sorry. See community PR for more details. Task-2710804 (Mail: Clean MailThread API) Prepares Task-2088884 (Mail: Use editable computed stored fields in composer)