odoo
odoo copied to clipboard
[IMP] mail: support rendering on void or falsy record sets
In this commit we support calling rendering methods on void or falsy record sets. Currently some rendering methods prevent from having 'None', some do nothing specific. As Qweb or inline template support rendering on void records we can safely support rendering on [], (), [False], [None]. Returned result will either be void, either contain the rendered on void record for the False or None key.
In this commit we also add a protection against trying to render a non existing field. Instead of raising a KeyError, a ValueError is raised with a clearer error message.
Task-2710804 (Mail: Clean MailThread Posting API)
@robodoo override=ci/security
Reason: triggers are linked to moving field parameters (sanitize) when modifying some fields definition. They have not been changed by this PR. Concerning getattr, it is linked to a code change, it was already present.
@robodoo r+ rebase-merge
Merge method set to rebase and merge, using the PR as merge commit message.
@tde-banana-odoo linked pull request(s) odoo/enterprise#34147 not ready. Linked PRs are not staged until all of them are ready.