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

Compute Method: _compute_show_check_availability

Inputs Method Outputs
""" According to `picking.show_check_availability`, the "Reserve" button will be
        displayed in the form view of a picking.
        """
for picking in self:
            if picking.state not in ('confirmed', 'waiting', 'assigned'):
                picking.show_check_availability = False
                continue
            if all(m.picked or m.product_uom_qty == m.quantity for m in picking.move_ids):
                picking.show_check_availability = False
                continue
            picking.show_check_availability = any(
                move.state in ('waiting', 'confirmed', 'partially_available') and
                move.uom_id.compare(move.product_uom_qty, 0)
                for move in picking.move_ids
            )

Back to entity