forked from elmau/empresa-libre
Add and delete warehouse
This commit is contained in:
parent
93f0d09f4d
commit
0512e0f6dd
|
@ -451,6 +451,8 @@ class Configuracion(BaseModel):
|
||||||
.where(Configuracion.clave.in_(fields))
|
.where(Configuracion.clave.in_(fields))
|
||||||
)
|
)
|
||||||
values = {r.clave: util.get_bool(r.valor) for r in data}
|
values = {r.clave: util.get_bool(r.valor) for r in data}
|
||||||
|
if not 'chk_multi_stock' in values:
|
||||||
|
values['chk_multi_stock'] = False
|
||||||
return values
|
return values
|
||||||
|
|
||||||
def _get_main_products(self, args={}):
|
def _get_main_products(self, args={}):
|
||||||
|
@ -3412,7 +3414,7 @@ class Almacenes(BaseModel):
|
||||||
return result
|
return result
|
||||||
|
|
||||||
if created:
|
if created:
|
||||||
rows = Almacenes._get_all()
|
rows = Almacenes._get_all({})
|
||||||
result = {'ok': True, 'rows': rows}
|
result = {'ok': True, 'rows': rows}
|
||||||
else:
|
else:
|
||||||
msg = 'El almacen ya existe'
|
msg = 'El almacen ya existe'
|
||||||
|
@ -3420,6 +3422,19 @@ class Almacenes(BaseModel):
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _delete(cls, args, user):
|
||||||
|
id = args['id']
|
||||||
|
try:
|
||||||
|
q = Almacenes.delete().where(Almacenes.id==id)
|
||||||
|
r = bool(q.execute())
|
||||||
|
result = {'ok': r}
|
||||||
|
except Exception as e:
|
||||||
|
log.error(e)
|
||||||
|
result = {'ok': False, 'msg': 'Ocurrio un error al intentar eliminar'}
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def post(cls, values, user):
|
def post(cls, values, user):
|
||||||
opt = values['opt']
|
opt = values['opt']
|
||||||
|
|
|
@ -565,6 +565,7 @@ function multi_admin_change(prevID, nextID){
|
||||||
}
|
}
|
||||||
|
|
||||||
if(nextID == 'app_options'){
|
if(nextID == 'app_options'){
|
||||||
|
//~ set_visible_warehouse(false)
|
||||||
get_config_values('templates')
|
get_config_values('templates')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue