Skip to content
Snippets Groups Projects
Commit 5f1ad0c1 authored by Nicolas Lempereur's avatar Nicolas Lempereur
Browse files

[FIX] web: accept is_html_empty in layout wizard


Scenario:
- edit the current document layout and use is_html_empty method in it
- it works in Preview Document, when printing any report, ...

=> it breaks when opening document layout wizard by clicking on
   "Configure Document Layout"

Reason: is_html_empty was added to _get_rendering_context, but the
preview instead the document layout wizard doesn't use this method.

Fix: add is_html_empty in the context

opw-3433583

closes odoo/odoo#133029

X-original-commit: c56942e8
Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
parent c4c43d10
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@ from odoo import api, fields, models, tools
from odoo.addons.base.models.ir_qweb_fields import nl2br
from odoo.modules import get_resource_path
from odoo.tools import html2plaintext
from odoo.tools import html2plaintext, is_html_empty
try:
import sass as libsass
......@@ -133,7 +133,11 @@ class BaseDocumentLayout(models.TransientModel):
wizard_with_logo = wizard
preview_css = markupsafe.Markup(self._get_css_for_preview(styles, wizard_with_logo.id))
ir_ui_view = wizard_with_logo.env['ir.ui.view']
wizard.preview = ir_ui_view._render_template('web.report_invoice_wizard_preview', {'company': wizard_with_logo, 'preview_css': preview_css})
wizard.preview = ir_ui_view._render_template('web.report_invoice_wizard_preview', {
'company': wizard_with_logo,
'preview_css': preview_css,
'is_html_empty': is_html_empty,
})
else:
wizard.preview = False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment