migrazione verso gitea
This commit is contained in:
69
docs/flows/gestione_pickinglist_flow.md
Normal file
69
docs/flows/gestione_pickinglist_flow.md
Normal file
@@ -0,0 +1,69 @@
|
||||
# `gestione_pickinglist.py`
|
||||
|
||||
## Scopo
|
||||
|
||||
Questo modulo gestisce la vista master/detail delle picking list e permette di:
|
||||
|
||||
- caricare l'elenco dei documenti;
|
||||
- vedere il dettaglio UDC della riga selezionata;
|
||||
- prenotare e s-prenotare una picking list;
|
||||
- mantenere una UI fluida con spinner e refresh differiti.
|
||||
|
||||
## Flusso di apertura
|
||||
|
||||
```{mermaid}
|
||||
flowchart TD
|
||||
A["open_pickinglist_window() da main.py"] --> B["create_pickinglist_frame()"]
|
||||
B --> C["GestionePickingListFrame.__init__()"]
|
||||
C --> D["_build_layout()"]
|
||||
D --> E["after_idle(_first_show)"]
|
||||
E --> F["reload_from_db(first=True)"]
|
||||
F --> G["query_json SQL_PL"]
|
||||
G --> H["_refresh_mid_rows()"]
|
||||
H --> I["Render tabella master"]
|
||||
```
|
||||
|
||||
## Flusso master/detail
|
||||
|
||||
```{mermaid}
|
||||
flowchart TD
|
||||
A["Utente seleziona checkbox riga"] --> B["on_row_checked()"]
|
||||
B --> C["Deseleziona altre righe"]
|
||||
C --> D["Salva detail_doc"]
|
||||
D --> E["query_json SQL_PL_DETAILS"]
|
||||
E --> F["_refresh_details()"]
|
||||
F --> G["Render tabella dettaglio"]
|
||||
```
|
||||
|
||||
## Prenotazione / s-prenotazione
|
||||
|
||||
```{mermaid}
|
||||
flowchart TD
|
||||
A["Click Prenota o S-prenota"] --> B["Verifica riga selezionata"]
|
||||
B --> C["Determina documento e stato atteso"]
|
||||
C --> D["Chiama sp_xExePackingListPallet_async()"]
|
||||
D --> E["Aggiorna Celle e LogPackingList sul DB"]
|
||||
E --> F["SPResult"]
|
||||
F --> G{"rc == 0?"}
|
||||
G -- Si --> H["_recolor_row_by_documento()"]
|
||||
G -- No --> I["Messaggio di errore"]
|
||||
```
|
||||
|
||||
## Schema di chiamata
|
||||
|
||||
```{mermaid}
|
||||
flowchart LR
|
||||
Init["__init__"] --> Build["_build_layout"]
|
||||
Init --> First["_first_show"]
|
||||
First --> Reload["reload_from_db"]
|
||||
Reload --> Mid["_refresh_mid_rows"]
|
||||
Check["on_row_checked"] --> Details["_refresh_details"]
|
||||
Pren["on_prenota"] --> SP["sp_xExePackingListPallet_async"]
|
||||
Spren["on_sprenota"] --> SP
|
||||
```
|
||||
|
||||
## Note
|
||||
|
||||
- Il modulo usa `AsyncRunner`, `BusyOverlay` e `ToolbarSpinner`.
|
||||
- Il caricamento iniziale è differito con `after_idle` per ridurre lo sfarfallio.
|
||||
- La riga selezionata viene tenuta separata dal dettaglio tramite `detail_doc`.
|
||||
Reference in New Issue
Block a user