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

Module: Mexico - SAT Connection

Entity: l10n_mx_sat.document

Compute Method: _compute_display_name

Inputs Method Outputs
fields_info = self.fields_get(["document_kind", "direction"])
kind_labels = dict(fields_info["document_kind"]["selection"])
direction_labels = dict(fields_info["direction"]["selection"])
for doc in self:
            parts = [doc.uuid or "?"]
            if doc.document_kind:
                parts.append(kind_labels.get(doc.document_kind, doc.document_kind))
            if doc.direction:
                parts.append(direction_labels.get(doc.direction, doc.direction))
            doc.display_name = " / ".join(parts)

Back to entity