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

Module: Purchase

Entity: purchase.order.line

Compute Method: _compute_allowed_uom_ids

View 19.0 View 20.0
Inputs Method Outputs
  • product_id
  • product_id.seller_ids
  • product_id.id
  • product_id.uom_id
  • product_id.uom_ids
for line in self:
            seller_uom = line.product_id.seller_ids.filtered(
                lambda s: s.product_id.id in {False, line.product_id.id},
-             ).product_uom_id
-             line.allowed_uom_ids = line.product_id.uom_id | line.product_id.uom_ids | seller_uom
+             ).uom_id
+             line.allowed_uom_ids = line.product_id._get_available_uoms() | seller_uom
  • allowed_uom_ids

Back to entity