[MIG] report_wkhtmltopdf_param: Migration to 15.0

This commit is contained in:
Maksym Yankin
2022-01-26 14:09:55 +02:00
parent ea2b47bb37
commit 82a699dcb4
5 changed files with 11 additions and 12 deletions

View File

@@ -33,11 +33,10 @@ class Paper(models.Model):
</body>
</html>
"""
contenthtml = [bytes(sample_html, "utf-8")]
report = self.env["ir.actions.report"].new(
{"paperformat_id": paperformat.id}
)
content = report._run_wkhtmltopdf(contenthtml)
content = report._run_wkhtmltopdf(sample_html)
if not content:
raise ValidationError(
_("Failed to create a PDF using the provided parameters.")