Tarea #3330 - idempresa y codalmacen opcionales en usuarios #1573
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Descripción
Necesitamos que en los usuarios el codalmacen e idempresa sean opcionales, de forma que si no se selecciona nada, se asumen los del panel de control. De esta forma cuando creamos una nueva empresa (al almacén) y queremos que sea la predeterminada, solamente hay que cambiarlo en el panel de control.
Se asigna null a idempresa y codalmacen en el método clear() de la clase User para que inicialmente el usuario no tenga ninguna configuración respecto a empresa o almacén y tome los datos de la configuración por defecto.
Eliminamos el testWarehouse que se encargaba de asignar la configuración por defecto a estos campos. Con esta implementación estos campos son null inicialmente.
Configuramos los campos como opcionales en el xml de la tabla.
Realizamos tests en PresupuestoCliente como se indica en la tarea.
AL ÚNICA PEGA QUE LE VEO ES QUE ESTOS CAMBIOS SOLO VAN A AFECTAR A USUARIOS NUEVOS YA QUE LOS QUE YA ESTÁN CREADOS YA TIENEN LOS VALORES POR DEFECTO ASIGNADOS Y AUNQUE SE CAMBIE EN LA CONFIGURACION POR DEFECTO SEGUIRAN CON EL VALOR ANTERIOR. SE DEBERÍAN SETEAR LOS DOS CAMPOS A NULL EN TODOS LOS USUARIOS.
¿Cómo has probado los cambios?
Toda modificación debe haber sido mínimamente probada. Marca o describe las pruebas que has realizado: