Skip to content
Snippets Groups Projects
Commit b1ddd9c9 authored by Raphael Collet's avatar Raphael Collet
Browse files

[FIX] base: avoid systematic invalidation of web.report_assets_common


The issue is: the user wants to send an invoice to a customer, changes
the email template, and after the onchange, the field "Template" of the
wizard is empty.

Here is what happens.  The onchange on the template renders a PDF file
with the corresponding invoice document.  The rendering builds some
assets to convert the invoice to a PDF document, and former assets are
deleted.  The deletion of former assets (`ir.attachment` records)
invalidates the whole record cache, which implicitly clears all the
fields of the record of the onchange.

The problem is that the asset is systematically invalidated by the
rendering of the report itself.  This hack changes the CSS assets to
introduce company-specific colors for the rendering of reports.  This
implementation is actually not consistent with the fact that assets are
kept in cache by the server.

This patch does not fix the root cause of the problem, but it reduces
the sides effects of it, and makes the issue above less frequent.  It
simply consists in not updating the asset's attachment when its value is
already correct.

OPW 2168623
OPW 2171040

closes odoo/odoo#44225

Signed-off-by: default avatarOlivier Dony (odo) <odo@openerp.com>
parent 955eec23
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment