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: mrp.unbuild

Compute Method: _compute_product_qty

View 18.0 View 20.0
Inputs Method Outputs
  • mo_id
  • has_tracking
  • mo_id.qty_produced
  • lot_ids
for order in self:
-             if order.mo_id:
-                 if order.has_tracking == 'serial':
-                     order.product_qty = 1
-                 else:
-                     order.product_qty = order.mo_id.qty_produced
+             if order.has_tracking == 'serial':
+                 order.product_qty = len(order.lot_ids) or 1
+             elif order.mo_id:
+                 order.product_qty = order.mo_id.qty_produced
  • product_qty

Back to entity