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

Module: Products & Pricelists

Entity: product.uom

Compute Method: _compute_allowed_uom_ids

Inputs Method Outputs
if self.env.context.get('active_model') == 'uom.uom':
            self.allowed_uom_ids = self.uom_id
            return
for product_uom in self:
            product = product_uom.product_id
            seller_uom = product.seller_ids.filtered(
                lambda s: not s.product_id or s.product_id == product
            ).uom_id
            product_uom.allowed_uom_ids = product._get_available_uoms() | seller_uom

Back to entity