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_valid_uom_ids

Inputs Method Outputs
for rec in self:
            if rec.product_id:
                root_id = int(rec.product_id.uom_id.parent_path.split("/")[0])
                rec.valid_uom_ids = self.env["uom.uom"].search(
                    [("id", "child_of", root_id)]
                )
            else:
                rec.valid_uom_ids = self.env["uom.uom"]

Back to entity