Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.
Module: Sales and Warehouse Management
Entity: sale.order.line
Compute Method: _compute_qty_to_deliver
| Inputs | Method | Outputs |
|---|---|---|
|
"""Compute the visibility of the inventory widget."""
for line in self:
line.qty_to_deliver = line.product_uom_qty - line.qty_delivered
- if line.state in ('draft', 'sent', 'sale') and line.is_storable and line.product_uom and line.qty_to_deliver > 0:
- if line.state == 'sale' and not line.move_ids:
+ if line.state in ('draft', 'sent', 'sale') and line.is_storable and line.product_uom_id and line.qty_to_deliver > 0:
+ if line.state == 'sale' and all(m.state in ['done', 'cancel'] for m in line.move_ids):
line.display_qty_widget = False
else:
line.display_qty_widget = True
else:
line.display_qty_widget = False
|
|
