From 2495997dad13b339f9a5009d7f8e4f9ebb11350f Mon Sep 17 00:00:00 2001 From: Mauricio Baeza Date: Tue, 23 Jan 2018 00:19:57 -0600 Subject: [PATCH] Fix - Issue #141 --- source/app/models/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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