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
def next_key(cls):
value = (Productos
.select(fn.Max(Productos.id))
.group_by(Productos.id)
.order_by(Productos.id)
.select(fn.Max(Productos.id).alias('fm'))
.order_by(SQL('fm'))
.scalar())
if value is None:
value = 1