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

Module: Manufacturing

Entity: stock.move

Compute Method: _compute_should_consume_qty

View 18.0 View 20.0
Inputs Method Outputs
  • raw_material_production_id
  • product_uom
  • unit_factor
  • product_uom.rounding
  • uom_id
for move in self:
            mo = move.raw_material_production_id
-             if not mo or not move.product_uom:
+             if not mo or not move.uom_id:
                move.should_consume_qty = 0
                continue
-             move.should_consume_qty = float_round((mo.qty_producing - mo.qty_produced) * move.unit_factor, precision_rounding=move.product_uom.rounding)
+             move.should_consume_qty = move.uom_id.round((mo.qty_producing - mo.qty_produced) * move.unit_factor)
  • should_consume_qty

Back to entity