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

Module: Manufacturing

Entity: stock.move

Compute Method: _compute_description_bom_line

Inputs Method Outputs
bom_line_description = {}
for bom in self.bom_line_id.bom_id:
            if bom.type != 'phantom':
                continue
            line_ids = self.bom_line_id.filtered(lambda line: line.bom_id == bom).mapped('id')
            total = len(line_ids)
            for i, line_id in enumerate(line_ids):
                bom_line_description[line_id] = '%s - %d/%d' % (bom.display_name, i + 1, total)
for move in self:
            move.description_bom_line = bom_line_description.get(move.bom_line_id.id, move.description_bom_line)

Back to entity