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

Module: Manage model export profiles

Entity: ir.exports.line

Compute Method: _compute_label

Inputs Method Outputs
"""Column label in a user-friendly format and language."""
for one in self:
            parts = list()
            for num in range(1, 5):
                field = one.field_n(num)
                if not field:
                    break
                # Translate label if possible
                try:
                    parts.append(
                        one.env[one.model_n(num).model]
                        ._fields[field.name]
                        .get_description(one.env)["string"]
                    )
                except KeyError:
                    # No human-readable string available, so empty this
                    parts = []
                    break
            one.label = (
                "{} ({})".format("/".join(parts), one.name)
                if parts and one.name
                else False
            )

Back to entity