Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Web

Entity: base.document.layout

Compute Method: _compute_preview

Inputs Method Outputs
""" compute a qweb based preview to display on the wizard """
styles = self._get_asset_style()
for wizard in self:
            if wizard.report_layout_id:
                if wizard.env.context.get('bin_size'):
                    # guarantees that bin_size is always set to False,
                    # so the logo always contains the bin data instead of the binary size
                    wizard = wizard.with_context(bin_size=False)
                wizard.preview = wizard.env['ir.ui.view']._render_template(
                    wizard._get_preview_template(),
                    wizard._get_render_information(styles),
                )
            else:
                wizard.preview = False

Back to entity