odoo icon indicating copy to clipboard operation
odoo copied to clipboard

[IMP] mail: support rendering on void or falsy record sets

Open tde-banana-odoo opened this issue 2 years ago • 1 comments

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)

tde-banana-odoo avatar Nov 18 '22 15:11 tde-banana-odoo

Pull request status dashboard

robodoo avatar Nov 18 '22 15:11 robodoo

@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.

tde-banana-odoo avatar Nov 21 '22 13:11 tde-banana-odoo

@robodoo r+ rebase-merge

tde-banana-odoo avatar Nov 21 '22 13:11 tde-banana-odoo

Merge method set to rebase and merge, using the PR as merge commit message.

robodoo avatar Nov 21 '22 13:11 robodoo

@tde-banana-odoo linked pull request(s) odoo/enterprise#34147 not ready. Linked PRs are not staged until all of them are ready.

robodoo avatar Nov 21 '22 14:11 robodoo