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.production
Compute Method: _compute_reservation_state
| Inputs | Method | Outputs |
|---|---|---|
|
for production in self:
if production.state in ('draft', 'done', 'cancel'):
production.reservation_state = False
continue
- relevant_move_state = production.move_raw_ids.filtered(lambda m: not (m.picked or float_is_zero(m.product_uom_qty, precision_rounding=m.product_uom.rounding)))._get_relevant_state_among_moves()
+ relevant_move_state = production.move_raw_ids.filtered(
+ lambda m: (
+ m.product_id
+ and not (
+ m.picked
+ or m.product_uom.is_zero(
+ m.product_uom_qty,
+ )
+ )
+ )
+ )._get_relevant_state_among_moves()
# Compute reservation state according to its component's moves.
if relevant_move_state == 'partially_available':
if production.workorder_ids.operation_id and production.bom_id.ready_to_produce == 'asap':
production.reservation_state = production._get_ready_to_produce_state()
else:
production.reservation_state = 'confirmed'
elif relevant_move_state != 'draft':
production.reservation_state = relevant_move_state
else:
production.reservation_state = False
|
|
