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

Module: Stock Cycle Count

Entity: stock.cycle.count.rule

Compute Method: _compute_warehouse_ids

Inputs Method Outputs
  • warehouse_id
  • warehouse_id.id
for record in self:
            wh_ids = []
            for loc in record.location_ids:
                if loc.warehouse_id:  # Make sure warehouse_id is set
                    wh_ids.append(loc.warehouse_id.id)
            wh_ids = list(set(wh_ids))  # Remove duplicates
            record.warehouse_ids = [(6, 0, wh_ids)]

Back to entity