Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
3307 Vistas

Hi guys

in V18 i will get the following error on test

Please indicate why the always invisible fields are present in the view, or remove the field tag.

as i understood in some cases like to use the filed on  modifier 'invisible' we dont need to have them anymore the views so we can remove them from view but in some case still we need to have some field always invisible in the view. do you have any idea how we can avoid such this error?


Best Regards

Avatar
Descartar

Did you miss something in the post ? seems no info about the error you face

Autor

No i did not missed the Error is 

Please indicate why the always invisible fields are present in the view, or remove the field tag.

and after that xml id the error will happen in Odoo test suite.

Mejor respuesta

Odoo enforces a warning system for "always invisible fields" to maintain code quality and optimization. While invisible fields are allowed for legitimate purposes (computations, conditional logic, technical requirements), developers must justify their presence through documentation. This serves as a code quality check to keep views clean and performant, encouraging intentional use of invisible fields with proper commenting.

You can avoid the warning by: 
Adding an XML comment before the invisible field:


<field name="helper_field" invisible="1"/> <!-- Required for computing total amount --> 

Avatar
Descartar
Autor

i Have already test it and it did not worked at all but if you do the comment in front of filed it will work like
<field name="helper_field" invisible="1"/> <!-- Required for computing total amount -->

Hi, this actually works, no need to add comment above the line:
<field name="field_name" invisible="1"/> <!-- Comment justifying the invisibility -->
This will work.

Publicaciones relacionadas Respuestas Vistas Actividad
3
ago 24
6677
3
feb 24
2266
1
may 22
3167
1
abr 22
3004
1
sept 16
10552