feat: enhance ProductPickerField to use rawName for initial query in receipt import

This commit is contained in:
Nils-Johan Gynther
2026-05-01 02:00:13 +02:00
parent f4fea7b92c
commit 47801935e9
2 changed files with 7 additions and 3 deletions
@@ -98,13 +98,14 @@ class _EditDialogState extends State<_EditDialog> {
_productName = item.suggestedProductName;
});
} else if (aiCategory != null) {
// Öppna pickern med kategorinamnet sökt
// Öppna pickern med råtexten från kvittot som sökord — kategorinamnet
// matchar inte produktnamn, men rawName gör det troligtvis
ProductPickerField.showSheet(
context,
products: widget.products,
value: _productId,
label: 'Produkt',
initialQuery: aiCategory,
initialQuery: item.rawName,
).then((id) {
if (id != null && mounted) {
setState(() {