---
title: "Inventory"
description: "Varasto ja varastot. Jokainen sovellus on moduuli samalla tietomallilla."
canonical: "https://obop-platform.sliplane.app/fi/apps/inventory/"
lang: "fi"
---

# Inventory

## Mihin se on tarkoitettu

Describe warehouses and locations, record stock levels and log stock moves. Quantities are entered by people, so it works as a ledger of what was counted and moved rather than an automatic stock engine.

## Mitä paketti tekee ja mitä ei

Warehouses, stock locations, stock levels and stock moves. Quantities are entered and validated by people; they are not updated automatically by moves.

## Mallit

### `inventory_warehouse`

A building or site where stock is kept

Lukuryhmä: `inventory.user`. Kirjoitusryhmä: `inventory.manager`.

| Kenttä | Tyyppi | Tietoluokka | Henkilötieto | Ryhmä | Agentit näkevät | Kuvaus |
|---|---|---|---|---|---|---|
| `name` | text | `none` | ei | `inventory.user` | selkoisena | Warehouse name |
| `code` | text | `none` | ei | `inventory.user` | selkoisena | Short code printed on documents, for example WH1 |
| `address` | longtext | `none` | ei | `inventory.user` | selkoisena | Postal address of the site |
| `active` | bool | `none` | ei | `inventory.user` | selkoisena | Whether the warehouse is in use |

### `inventory_location`

A place inside a warehouse where stock can sit

Lukuryhmä: `inventory.user`. Kirjoitusryhmä: `inventory.manager`.

| Kenttä | Tyyppi | Tietoluokka | Henkilötieto | Ryhmä | Agentit näkevät | Kuvaus |
|---|---|---|---|---|---|---|
| `name` | text | `none` | ei | `inventory.user` | selkoisena | Location name, for example Shelf A3 |
| `warehouse_id` | ref → inventory_warehouse | `none` | ei | `inventory.user` | selkoisena | The warehouse the location belongs to |
| `kind` | select (internal, receiving, shipping, transit, scrap) | `none` | ei | `inventory.user` | selkoisena | What the location is used for: internal, receiving, shipping, transit, scrap |
| `active` | bool | `none` | ei | `inventory.user` | selkoisena | Whether the location is in use |

### `inventory_item`

The quantity of one product held at one location

Lukuryhmä: `inventory.user`. Kirjoitusryhmä: `inventory.manager`.

| Kenttä | Tyyppi | Tietoluokka | Henkilötieto | Ryhmä | Agentit näkevät | Kuvaus |
|---|---|---|---|---|---|---|
| `product_id` | ref → product | `none` | ei | `inventory.user` | selkoisena | The product held |
| `location_id` | ref → inventory_location | `none` | ei | `inventory.user` | selkoisena | Where it is held |
| `quantity` | number | `none` | ei | `inventory.user` | selkoisena | Units on hand |
| `reorder_level` | number | `none` | ei | `inventory.user` | selkoisena | Quantity at or below which the product should be replenished |
| `lot` | text | `none` | ei | `inventory.user` | selkoisena | Lot or batch number, if tracked |

### `inventory_move`

A movement of a product between locations, or into or out of the business

Lukuryhmä: `inventory.user`. Kirjoitusryhmä: `inventory.user`.

| Kenttä | Tyyppi | Tietoluokka | Henkilötieto | Ryhmä | Agentit näkevät | Kuvaus |
|---|---|---|---|---|---|---|
| `reference` | text | `none` | ei | `inventory.user` | selkoisena | Reference of the move, for example a delivery or receipt number |
| `product_id` | ref → product | `none` | ei | `inventory.user` | selkoisena | The product moved |
| `from_location_id` | ref → inventory_location | `none` | ei | `inventory.user` | selkoisena | Where it leaves; empty for a receipt from a supplier |
| `to_location_id` | ref → inventory_location | `none` | ei | `inventory.user` | selkoisena | Where it arrives; empty for a delivery to a customer |
| `quantity` | number | `none` | ei | `inventory.user` | selkoisena | Units moved |
| `scheduled_on` | date | `none` | ei | `inventory.user` | selkoisena | Date the move is planned for (YYYY-MM-DD) |
| `state` | select (draft, done, cancelled) | `none` | ei | `inventory.user` | selkoisena | Move status: draft, done, cancelled |

## Työnkulut

### `inventory_move`

| Toiminto | Siirtää | Kuka voi suorittaa | Hyväksyntä |
|---|---|---|---|
| `inventory_move.validate` | state: draft → done | `inventory.user` | kyllä |
| `inventory_move.cancel` | state: draft → cancelled | `inventory.user` | ei |

## Käyttöoikeusryhmät

Tämän sovelluksen käyttämät ryhmät:

- `inventory.manager`
- `inventory.user`

## Hyväksyntävaiheet

Vaiheet, joita agentti voi vain ehdottaa:

- `inventory_move.validate`

## Mitä agentit voivat ja eivät voi tehdä

Agentti voi lukea, hakea, luoda ja päivittää tämän sovelluksen tietueita sekä suorittaa toiminnot, jotka eivät vaadi hyväksyntää, tunnisteensa käyttöoikeusryhmien rajoissa.

Se voi vain ehdottaa näitä vaiheita, ja ihmisen on hyväksyttävä ne: `inventory_move.validate`, `inventory_warehouse.delete`, `inventory_location.delete`, `inventory_item.delete`, `inventory_move.delete`.

## Riippuvuudet

- `product`

## Asennus

Asenna se Customize-sovelluksesta (Marketplace) tai komentoriviltä:

```bash
obop modules install-from inventory
```

Vaatii tietokannan ja ylläpitäjän oikeudet.

## Tee oma

[Moduulioppaassa näytetään, miten tällaiset sovellukset kirjoitetaan](/fi/docs/reference/module-manifest/)
