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

Module: Stock Transport

Entity: stock.picking.batch

Compute Method: _compute_dock_id

View 19.0
Inputs Method Outputs
  • picking_type_id
  • dock_id
  • picking_ids
  • picking_ids.location_id
  • allowed_dock_ids
+ for batch in self:
+             if batch.picking_type_id != batch._origin.picking_type_id and batch.dock_id:
+                 batch.dock_id = False
+             if batch.picking_ids and len(batch.picking_ids.location_id) == 1 and batch.picking_ids.location_id in batch.allowed_dock_ids:
+                 batch.dock_id = batch.picking_ids.location_id
  • dock_id

Back to entity