Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
3751 Vizualizări

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

Imagine profil
Abandonează

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.

Cel mai bun răspuns

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 --> 

Imagine profil
Abandonează
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.

Related Posts Răspunsuri Vizualizări Activitate
3
aug. 24
6908
3
feb. 24
2407
1
mai 22
3304
1
apr. 22
3134
1
sept. 16
10705