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

View 19.0
Inputs Method Outputs
  • product_id
  • product_id.uom_id
  • product_id.uom_id.parent_path
+ 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"]
  • valid_uom_ids

Back to entity