Fix new services implementation 9

This commit is contained in:
Urtzi Alfaro
2025-08-16 08:00:52 +02:00
parent 055ce10c66
commit 9de0f9943c
5 changed files with 37 additions and 83 deletions

View File

@@ -505,7 +505,11 @@ class AIOnboardingService:
"description": modifications.get("description") or approval.get("notes", ""),
# Optional fields
"brand": modifications.get("brand") or approval.get("suggested_supplier"),
"is_active": True
"is_active": True,
# Explicitly set boolean fields to ensure they're not NULL
"requires_refrigeration": modifications.get("requires_refrigeration", approval.get("requires_refrigeration", False)),
"requires_freezing": modifications.get("requires_freezing", approval.get("requires_freezing", False)),
"is_perishable": modifications.get("is_perishable", approval.get("is_perishable", False))
}
# Add optional numeric fields only if they exist