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 = bom.bom_line_ids.ids
            total = len(line_ids)
            name = bom.display_name
            for i, line_id in enumerate(line_ids):
                bom_line_description[line_id] = '%s - %d/%d' % (name, i+1, total)
for move in self:
            move.description_bom_line = bom_line_description.get(move.bom_line_id.id)

Back to entity