Gebinde-Bezeichnung je Produkt + Spalte "Einheiten (ist / soll)"

- Neues Feld products.package_label: pro Artikel einstellbar, wie das Gebinde
  heisst (Packung, Glas, Tuete, Flasche, Dose, Tube, ...) - Eingabe mit
  Vorschlagsliste, frei ueberschreibbar. Migration per ADD COLUMN IF NOT EXISTS.
- Produkttabelle: Spalte "Packungen" heisst jetzt "Einheiten (ist / soll)" und
  zeigt Bestand und Mindestbestand als "11 / 12 Glas"; die separate Spalte
  "Mindest" entfaellt. Das "niedrig"-Badge sitzt jetzt dort.
- Die Bezeichnung wird ueberall verwendet (Chargenanzeige, Einheiten-Umschalter
  beim Bearbeiten, Mindestbestand-Auswahl, Umrechnungshinweis).
- Speichern/Abbrechen im Chargen-Editor sind jetzt gleich breit (.btn-pair).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Scarriffle
2026-07-22 13:39:44 +02:00
parent c065b8879d
commit 3884919a4c
7 changed files with 54 additions and 20 deletions

View File

@@ -41,6 +41,7 @@ def _ensure_schema() -> None:
"REFERENCES units(id) ON DELETE SET NULL",
"ALTER TABLE products ADD COLUMN IF NOT EXISTS min_stock_in_packages BOOLEAN "
"NOT NULL DEFAULT FALSE",
"ALTER TABLE products ADD COLUMN IF NOT EXISTS package_label VARCHAR(32)",
]
with engine.begin() as conn:
for stmt in stmts: