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
+1 -1
View File
@@ -9,7 +9,7 @@ branches:
python:
# Force a newer version than 3.7.1 which break build
# due to https://bugs.python.org/issue34921
- "3.7.2"
- "3.8"
addons:
postgresql: "9.5"
+10
View File
@@ -0,0 +1,10 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License
============================
Kwktnkltopdf Asset
============================
Force assets to be saved to be readable by kwkhtmltopdf server, the
first time you print a report it failed to generate
the pdf asset used for pdf
+2
View File
@@ -0,0 +1,2 @@
from . import models
+17
View File
@@ -0,0 +1,17 @@
# Copyright 2016-2021 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
{
"name": "Kwkhtmltopdf: Asset fix",
"version": "16.0.1.0.0",
"author": "Camptocamp,Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "category",
"depends": [
"base",
],
"website": "http://www.camptocamp.com",
"data": [],
"installable": True,
}
+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
)
@@ -0,0 +1,2 @@
# addons listed in this file are ignored by
# setuptools-odoo-make-default (one addon per line)
+2
View File
@@ -0,0 +1,2 @@
To learn more about this directory, please visit
https://pypi.python.org/pypi/setuptools-odoo
+1 -1
View File
@@ -5,7 +5,7 @@ redis==4.3.4
python-json-logger==2.0.4
statsd==4.0.1
python-swiftclient==4.1.0
python-keystoneclient==5.0.1
python-keystoneclient==5.0.0
keystoneauth1==5.0.0
# error with 5.x (ConstructorError: could not determine a constructor for the tag '!record')
PyYAML==6.0