Initial commit: Odoo 18.0-20251222 extra-addons
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
tests / Detect unreleased dependencies (push) Has been cancelled
tests / test with OCB (push) Has been cancelled
tests / test with Odoo (push) Has been cancelled

This commit is contained in:
tocmo0nlord
2026-03-13 20:43:25 +00:00
parent 36e847a7df
commit adbe430761
9472 changed files with 1265727 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
# Copyright 2017 Avoin.Systems
# Copyright 2017 ForgeFlow, S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import test_report_paperformat

View File

@@ -0,0 +1,38 @@
# Copyright 2017 Avoin.Systems
# Copyright 2017 ForgeFlow, S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
import logging
import odoo.tests
from odoo.exceptions import ValidationError
from odoo.tests.common import tagged
@tagged("post_install", "-at_install")
class TestWkhtmltopdf(odoo.tests.TransactionCase):
def test_wkhtmltopdf_incorrect_parameter(self):
for report_paperformat in self.env["report.paperformat"].search([]):
with (
self.assertRaises(ValidationError),
self.assertLogs(level=logging.WARNING),
):
report_paperformat.update(
{"custom_params": [(0, 0, {"name": "bad-parameter"})]}
)
def test_wkhtmltopdf_valid_parameter(self):
for report_paperformat in self.env["report.paperformat"].search([]):
error = False
try:
report_paperformat.update(
{"custom_params": [(0, 0, {"name": "--disable-smart-shrinking"})]}
)
except ValidationError:
error = True
self.assertEqual(
error,
False,
"There was an error adding wkhtmltopdf "
"parameter --disable-smart-shrinking",
)