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.line

Compute Method: _compute_visual_lot_name

Inputs Method Outputs
self.visual_lot_name = False
final_move_lines = self - self.production_id.move_byproduct_ids.move_line_ids
for production, lines in final_move_lines.grouped('production_id').items():
            lots = production.lot_producing_ids
            if not production or not lots:
                continue
            if len(lots) == 1:  # If tracked by lot or only one serial number
                lines.visual_lot_name = lots[0].name
                continue
            for line, lot in zip(lines, lots):
                line.visual_lot_name = lot.name

Back to entity