Fix - Al borrar impuestos
This commit is contained in:
parent
eb89b8e8fa
commit
ff21b3c8bc
|
@ -785,8 +785,11 @@ class SATImpuestos(BaseModel):
|
||||||
@classmethod
|
@classmethod
|
||||||
def remove(cls, id):
|
def remove(cls, id):
|
||||||
with database_proxy.transaction():
|
with database_proxy.transaction():
|
||||||
q = SATImpuestos.delete().where(SATImpuestos.id==id)
|
try:
|
||||||
return bool(q.execute())
|
q = SATImpuestos.delete().where(SATImpuestos.id==id)
|
||||||
|
return bool(q.execute())
|
||||||
|
except IntegrityError:
|
||||||
|
return False
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_(self):
|
def get_(self):
|
||||||
|
|
|
@ -1099,10 +1099,13 @@ function borrar_impuesto(row){
|
||||||
var grid = $$('grid_admin_taxes')
|
var grid = $$('grid_admin_taxes')
|
||||||
|
|
||||||
webix.ajax().del('/values/satimpuesto', {id: row}, function(text, xml, xhr){
|
webix.ajax().del('/values/satimpuesto', {id: row}, function(text, xml, xhr){
|
||||||
var msg = 'Impuesto eliminado correctamente'
|
msg = 'Impuesto eliminado correctamente'
|
||||||
if(xhr.status == 200){
|
if(xhr.status == 200){
|
||||||
grid.remove(row)
|
grid.remove(row)
|
||||||
msg_sucess(msg)
|
msg_sucess(msg)
|
||||||
|
}else{
|
||||||
|
msg = 'Impuesto en uso, no se pudo eliminar.'
|
||||||
|
msg_sucess(msg)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue