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_ddmrp_chart_execution

Inputs Method Outputs
for rec in self:
            # On new records in v19, onchange triggers this before product_id is set,
            # leaving product_uom empty (rounding=0.0).
            if not rec.product_id:
                rec.ddmrp_chart_execution = json.dumps({"div": "", "script": ""})
                continue
            div, script = rec.get_ddmrp_chart_execution()
            json_data = json.dumps(
                {
                    "div": div,
                    "script": script,
                }
            )
            rec.ddmrp_chart_execution = json_data

Back to entity