forked from elmau/empresa-libre
Fix - clave siguiente en productos
This commit is contained in:
parent
e690aa3ce9
commit
6184a8c892
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue