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

Module: Indonesia E-faktur

Entity: l10n_id_efaktur.document

Compute Method: _compute_name

Inputs Method Outputs
""" First compute will be done at creation, from a selection of invoice(s).
        We still want to allow to rename the document to another name if it makes sense.
        """
for doc in self:
            sorted_invoices = doc.invoice_ids.sorted('name')
            name = []
            if sorted_invoices:
                name.append(sorted_invoices[0].name)
                if len(sorted_invoices) > 1:
                    name.append(sorted_invoices[-1].name)
            doc.name = "%s - Efaktur (%s)" % (fields.Date.context_today(doc).strftime("%Y%m%d"), "....".join(name))

Back to entity