Fix - clave siguiente en productos

This commit is contained in:
Mauricio Baeza 2017-11-01 10:40:28 -06:00
parent e690aa3ce9
commit 6184a8c892
1 changed files with 2 additions and 3 deletions

View File

@ -832,9 +832,8 @@ class Productos(BaseModel):
@classmethod @classmethod
def next_key(cls): def next_key(cls):
value = (Productos value = (Productos
.select(fn.Max(Productos.id)) .select(fn.Max(Productos.id).alias('fm'))
.group_by(Productos.id) .order_by(SQL('fm'))
.order_by(Productos.id)
.scalar()) .scalar())
if value is None: if value is None:
value = 1 value = 1