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

Module: Sales

Entity: sale.order.line

Compute Method: _compute_display_qty_widget

Inputs Method Outputs
"""Compute the visibility of the inventory widget."""
for line in self:
            qty_to_deliver = line.product_uom_qty - line.qty_delivered
            if line.state in ("draft", "sent", "sale") and line.is_storable and qty_to_deliver > 0:
                line.display_qty_widget = True
            else:
                line.display_qty_widget = False

Back to entity