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