diff --git a/source/app/models/main.py b/source/app/models/main.py index 71e92e4..305c03c 100644 --- a/source/app/models/main.py +++ b/source/app/models/main.py @@ -2219,7 +2219,10 @@ class Productos(BaseModel): .order_by(Productos.clave) .tuples() ) - value = max([int(v[0]) for v in values if v[0].isdigit()]) + values = [int(v[0]) for v in values if v[0].isdigit()] + value = 0 + if values: + value = max(values) value = value or 0 value += 1