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 Discrepancy

Entity: stock.quant

Compute Method: _compute_discrepancy

Inputs Method Outputs
  • quantity
  • inventory_quantity_set
  • inventory_diff_quantity
for quant in self:
            if not quant.quantity or not quant.inventory_quantity_set:
                quant.discrepancy_percent = 0
            else:
                quant.discrepancy_percent = abs(
                    100 * (quant.inventory_diff_quantity) / quant.quantity
                )

Back to entity