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_procure_recommended_qty

Inputs Method Outputs
subtract_qty = self.sudo()._quantity_in_progress()
for rec in self:
            procure_recommended_qty = 0.0
            # uses _origin because onchange uses a NewId with the record wrapped
            if rec._origin and rec.net_flow_position < rec.top_of_yellow:
                qty = (
                    rec.top_of_green
                    - rec.net_flow_position
                    - subtract_qty[rec._origin.id]
                )
                if qty >= 0.0:
                    procure_recommended_qty = qty
            elif rec._origin:
                if subtract_qty[rec._origin.id] > 0.0:
                    procure_recommended_qty -= subtract_qty[rec._origin.id]

            adjusted_qty = 0.0
            if procure_recommended_qty > 0.0:
                adjusted_qty = rec._adjust_procure_qty(procure_recommended_qty)
            rec.procure_recommended_qty = adjusted_qty

Back to entity