feat: add kwkhtmltopdf asset fix (#395)

* feat: add kwkhtmltopdf asset fix
This commit is contained in:
Vincent Renaville
2022-12-12 10:31:16 +01:00
committed by GitHub
co-authored by GitHub
parent fc452c6a2a
commit 91e8999b5c
9 changed files with 67 additions and 2 deletions
+2
View File
@@ -0,0 +1,2 @@
from . import ir_qweb
+30
View File
@@ -0,0 +1,30 @@
# Copyright 2016-2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
from odoo.tools import config
from odoo import models
class IrQweb(models.AbstractModel):
_inherit = "ir.qweb"
def _generate_asset_nodes_cache(
self,
bundle,
css=True,
js=True,
debug=False,
async_load=False,
defer_load=False,
lazy_load=False,
media=None,
):
context_for_printing = self.env.context.copy()
if not config["test_enable"]:
context_for_printing["commit_assetsbundle"] = True
return super(
IrQweb, self.with_context(**context_for_printing)
)._generate_asset_nodes(
bundle, css, js, debug, async_load, defer_load, lazy_load, media
)