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

Module: Discuss

Entity: mail.composer.mixin

Compute Method: _compute_body_has_template_value

Inputs Method Outputs
""" Computes if the current body is the same as the one from template.
        Both real and sanitized values are considered, to avoid editor issues
        as much as possible. """
for composer_mixin in self:
            if not tools.is_html_empty(composer_mixin.body) and composer_mixin.template_id:
                template_value = composer_mixin.template_id.body_html
                sanitized_template_value = tools.html_sanitize(template_value)
                composer_mixin.body_has_template_value = composer_mixin.body in (template_value, sanitized_template_value)
            else:
                composer_mixin.body_has_template_value = False

Back to entity