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

Module: DDMRP

Entity: stock.buffer

Compute Method: _compute_red_zone

Inputs Method Outputs
for rec in self:
            if rec.product_id and rec.replenish_method in ["replenish", "min_max"]:
                dlt = rec.dlt + rec.extra_lead_time
                rec.red_base_qty = float_round(
                    dlt * rec.adu * rec.buffer_profile_id.lead_time_id.factor,
                    precision_rounding=rec.product_uom.rounding,
                )
                rec.red_safety_qty = float_round(
                    rec.red_base_qty * rec.buffer_profile_id.variability_id.factor,
                    precision_rounding=rec.product_uom.rounding,
                )
                rec.red_zone_qty = rec.red_base_qty + rec.red_safety_qty
            elif rec.product_id and rec.replenish_method == "replenish_override":
                rec.red_zone_qty = rec.red_override
            else:
                rec.red_zone_qty = 0.0

Back to entity