[FIX] base: manifest cache is empty using cron

When generating some sale order/invoices pdf automatically (via cron for example), the format of the
invoice is not correct (missing style, background image, etc). The html used to generate these pdf's
misses the asset lines (link to css and js files).

The asset lines are not generated because the manifest cache (http.addons_manifest) is empty if we
render a pdf from a cron.

This commit will generate http.addons_manifest if it's not yet done before.

opw-2581621
opw-2597990
opw-2542242

closes odoo/odoo#75092

X-original-commit: 3ae4db7fc8dbc404984e34ac532426d6bf2c6a0f
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
Signed-off-by: ThomasBeckers <ThomasBeckers@users.noreply.github.com>
This commit is contained in:
Thomas Beckers
2021-09-06 10:42:44 +00:00
parent fd41a4e7a2
commit 50c8eb1f8b
+4
View File
@@ -12,6 +12,7 @@ from odoo.tools import misc
from odoo import tools
from odoo.addons import __path__ as ADDONS_PATH
from odoo import api, fields, http, models
from odoo.http import root
_logger = getLogger(__name__)
@@ -140,6 +141,9 @@ class IrAsset(models.Model):
if bundle in seen:
raise Exception("Circular assets bundle declaration: %s" % " > ".join(seen + [bundle]))
if not root._loaded:
root.load_addons()
root._loaded = True
manifest_cache = http.addons_manifest
exts = []
if js: