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

Module: Inventory

Entity: stock.move.line

Compute Method: _compute_location_id

View 19.0 View 20.0
Inputs Method Outputs
  • location_id
  • picking_id
  • picking_id.location_id
  • move_id
  • move_id.location_id
  • location_dest_id
  • picking_id.location_dest_id
  • move_id.location_dest_id
for line in self:
            if not line.location_id or line._origin.picking_id.location_id != line.picking_id.location_id:
                line.location_id = line.move_id.location_id or line.picking_id.location_id
-             if not line.location_dest_id or line._origin.picking_id.location_dest_id != line.picking_id.location_dest_id:
-                 line.location_dest_id = line.move_id.location_dest_id or line.picking_id.location_dest_id
  • location_id
  • location_dest_id

Back to entity