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

Module: Stock Inventory Adjustment

Entity: stock.inventory

Compute Method: _compute_count_stock_quants

Inputs Method Outputs
for rec in self:
            current_inventory_id = rec.id
            quants = rec.stock_quant_ids
            quants_to_do = quants.filtered(lambda q: q.to_do)
            quants_pending_to_review = [
                q
                for q in quants_to_do
                if q.current_inventory_id.id == current_inventory_id
            ]
            count_pending_to_review = len(quants_pending_to_review)
            rec.count_stock_quants = len(quants)
            rec.count_stock_quants_string = "{} / {}".format(
                count_pending_to_review, rec.count_stock_quants
            )

Back to entity