# UoM Categories

## Overview

UoM Categories organize units of measure into logical groupings where conversions are meaningful. Each category has a designated reference unit that serves as the base for all conversion calculations within that category. Units can only be converted to other units within the same category.

This feature enables businesses to define their measurement standards while maintaining mathematical consistency across all unit conversions.

## Business Purpose

Organizations need to track quantities in various units depending on context - purchasing in bulk units, selling in retail units, and managing inventory in standardized units. UoM Categories ensure that:

- Conversions only occur between compatible units (you cannot convert kilograms to liters)
- A single source of truth exists for conversion factors via the reference unit
- New units can be added without updating relationships to every other unit
- Mathematical precision is maintained through a single conversion path

## Process Flow

```mermaid
flowchart TD
    A[Create Category] --> B{Has Reference Unit?}
    B -->|No| C[Create Reference Unit]
    C --> D[Set as Category Reference]
    B -->|Yes| E[Add Additional Units]
    D --> E
    E --> F[Define Conversion Factor]
    F --> G{More Units?}
    G -->|Yes| E
    G -->|No| H[Category Ready]
    H --> I[Products Can Reference Units]
```

## Scenario Patterns

- **Initial Setup**: Administrator creates standard categories (Unit, Weight, Volume, Length, Time) with reference units during system initialization
- **Industry-Specific Units**: Manufacturing adds custom units like "Pallet" or "Roll" to the Unit category with appropriate conversion factors
- **Regional Adaptation**: Business operating in multiple regions adds both metric and imperial units to Weight and Length categories
- **Precision Requirements**: Pharmaceutical company creates units with high decimal precision for precise dosage tracking

## Test Cases

- Creating a category without a reference unit should fail or prompt for reference unit creation
- Setting a reference unit should automatically set its conversion factor to 1.0
- Deleting a reference unit should be prevented if other units exist in the category
- Category names must be unique within the system
- Deactivating a category should prevent new products from using its units

## Reference Links

- [Odoo Units of Measure Documentation](https://www.odoo.com/documentation/19.0/applications/inventory_and_mrp/inventory/product_management/configure/uom.html)
- [ISO 80000 Quantities and Units Standard](https://www.iso.org/standard/76921.html)
